async fixed

This commit is contained in:
Drew Ansbacher
2021-09-16 10:18:42 -06:00
committed by Aiden McClelland
parent fd62de7a91
commit cfc937f17a
3 changed files with 34 additions and 38 deletions

View File

@@ -177,7 +177,7 @@
<ion-toolbar style="border-top: 1px solid var(--ion-color-dark);" color="light">
<ion-list>
<ion-list-header>
<ion-label>Install Progress</ion-label>
<ion-label>Install Progress: {{ (100 * (osUpdateProgress?.downloaded || 1) / (osUpdateProgress?.size || 1)).toFixed(0) }}%</ion-label>
</ion-list-header>
<div style="padding: 0 15px;">
<ion-progress-bar

View File

@@ -105,10 +105,7 @@ export class WizardBaker {
action,
verb: 'beginning update for',
title,
executeAction: async () => {
this.embassyApi.updateServer({ })
return
},
executeAction: () => this.embassyApi.updateServer({ }),
},
},
bottomBar: {

View File

@@ -119,40 +119,8 @@ export class MockApiService extends ApiService {
},
]
const res = await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
console.log('update progress created')
await this.updateOSProgress(initialProgress.size)
console.log('about to update')
setTimeout(async () => {
const patch = [
{
op: PatchOp.REPLACE,
path: '/server-info/status',
value: ServerStatus.Running,
},
{
op: PatchOp.REPLACE,
path: '/server-info/version',
value: '3.1.0',
},
{
op: PatchOp.REMOVE,
path: '/server-info/update-progress',
},
]
await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
// quickly revert patch to proper version to prevent infinite refresh loop
const patch2 = [
{
op: PatchOp.REPLACE,
path: '/server-info/version',
value: require('../../../../package.json').version,
},
]
this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch: patch2 } })
}, 10000)
this.updateOSProgress(initialProgress.size)
return res
}
@@ -607,5 +575,36 @@ export class MockApiService extends ApiService {
},
]
await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
setTimeout(async () => {
const patch = [
{
op: PatchOp.REPLACE,
path: '/server-info/status',
value: ServerStatus.Running,
},
{
op: PatchOp.REPLACE,
path: '/server-info/version',
value: '3.1.0',
},
{
op: PatchOp.REMOVE,
path: '/server-info/update-progress',
},
]
await this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch } })
// quickly revert patch to proper version to prevent infinite refresh loop
const patch2 = [
{
op: PatchOp.REPLACE,
path: '/server-info/version',
value: require('../../../../package.json').version,
},
]
this.http.rpcRequest<WithRevision<null>>({ method: 'db.patch', params: { patch: patch2 } })
}, 10000)
}
}