mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 18:31:52 +00:00
remove sourceVersion and minor cleanup
This commit is contained in:
@@ -3,7 +3,6 @@ import { T } from '@start9labs/start-sdk'
|
||||
export type GetPackageReq = {
|
||||
id: string
|
||||
version: string | null
|
||||
sourceVersion: null // @TODO what is this?
|
||||
otherVersions: 'short'
|
||||
}
|
||||
export type GetPackageRes = T.GetPackageResponse & {
|
||||
@@ -13,9 +12,9 @@ export type GetPackageRes = T.GetPackageResponse & {
|
||||
export type GetPackagesReq = {
|
||||
id: null
|
||||
version: null
|
||||
sourceVersion: null
|
||||
otherVersions: 'short'
|
||||
}
|
||||
|
||||
export type GetPackagesRes = {
|
||||
[id: T.PackageId]: GetPackageRes
|
||||
}
|
||||
|
||||
@@ -58,9 +58,7 @@ export class InitService extends Observable<MappedProgress> {
|
||||
}
|
||||
}),
|
||||
catchError(e => {
|
||||
// @TODO Alex this toast is presenting when we navigate away from init page. It seems other websockets exhibit the same behavior, but we never noticed because the error were not being caught and presented in this manner. It seems odd that unsubscribing from a websocket subject would be treated as an error.
|
||||
// this.errorService.handleError(e)
|
||||
|
||||
console.error(e)
|
||||
return EMPTY
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -138,8 +138,8 @@ export class SideloadPage {
|
||||
).getUint32(0, false)
|
||||
await getPositions(start, end, file, positions, tocLength as any)
|
||||
|
||||
await this.getManifest(positions, file)
|
||||
await this.getIcon(positions, file)
|
||||
await this.getManifestV1(positions, file)
|
||||
await this.getIconV1(positions, file)
|
||||
}
|
||||
|
||||
async parseS9pkV2(file: File) {
|
||||
@@ -148,7 +148,7 @@ export class SideloadPage {
|
||||
this.toUpload.icon = await s9pk.icon()
|
||||
}
|
||||
|
||||
async getManifest(positions: Positions, file: Blob) {
|
||||
private async getManifestV1(positions: Positions, file: Blob) {
|
||||
const data = await blobToBuffer(
|
||||
file.slice(
|
||||
Number(positions['manifest'][0]),
|
||||
@@ -158,12 +158,11 @@ export class SideloadPage {
|
||||
this.toUpload.manifest = await cbor.decode(data, true)
|
||||
}
|
||||
|
||||
async getIcon(positions: Positions, file: Blob) {
|
||||
const contentType = '' // @TODO
|
||||
private async getIconV1(positions: Positions, file: Blob) {
|
||||
const data = file.slice(
|
||||
Number(positions['icon'][0]),
|
||||
Number(positions['icon'][0]) + Number(positions['icon'][1]),
|
||||
contentType,
|
||||
'',
|
||||
)
|
||||
this.toUpload.icon = await blobToDataURL(data)
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export class LiveApiService extends ApiService {
|
||||
@Inject(PATCH_CACHE) private readonly cache$: Observable<Dump<DataModel>>,
|
||||
) {
|
||||
super()
|
||||
;(window as any).rpcClient = this
|
||||
; (window as any).rpcClient = this
|
||||
}
|
||||
|
||||
// for sideloading packages
|
||||
@@ -321,7 +321,6 @@ export class LiveApiService extends ApiService {
|
||||
const params: GetPackageReq = {
|
||||
id,
|
||||
version: versionRange,
|
||||
sourceVersion: null,
|
||||
otherVersions: 'short',
|
||||
}
|
||||
|
||||
@@ -335,7 +334,6 @@ export class LiveApiService extends ApiService {
|
||||
const params: GetPackagesReq = {
|
||||
id: null,
|
||||
version: null,
|
||||
sourceVersion: null,
|
||||
otherVersions: 'short',
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ export class PatchDbSource extends Observable<Update<DataModel>[]> {
|
||||
catchError((_, original$) => {
|
||||
this.state.retrigger()
|
||||
|
||||
// @TODO this is returning right away, but we need to wait until state emits again from the retrigger() above.
|
||||
// @TODO Alex this is returning right away and crashing the browser, but we need to wait until state emits again from the retrigger() above.
|
||||
return this.state.pipe(
|
||||
filter(current => current === 'running'),
|
||||
take(1),
|
||||
|
||||
@@ -111,7 +111,7 @@ export class StateService extends Observable<RR.ServerState | null> {
|
||||
),
|
||||
),
|
||||
)
|
||||
.subscribe() // @TODO shouldn't this be subscribed in app component with the others? Do we ever need to unsubscribe?
|
||||
.subscribe() // @TODO Alex shouldn't this be subscribed in app component with the others? Do we ever need to unsubscribe?
|
||||
|
||||
constructor() {
|
||||
super(subscriber => this.stream$.subscribe(subscriber))
|
||||
|
||||
Reference in New Issue
Block a user