timestamp sorting

This commit is contained in:
Aaron Greenspan
2021-01-13 18:02:00 -07:00
committed by Aiden McClelland
parent 90b412384a
commit d7508345eb
3 changed files with 10 additions and 2 deletions

View File

@@ -83,7 +83,12 @@ export class LiveApiService extends ApiService {
}
async getAvailableApps (): Promise<AppAvailablePreview[]> {
return this.authRequest<ReqRes.GetAppsAvailableRes>({ method: Method.GET, url: '/apps/store' })
const res = await this.authRequest<ReqRes.GetAppsAvailableRes>({ method: Method.GET, url: '/apps/store' })
return res.map(a => {
const latestVersionTimestamp = new Date(a.latestVersionTimestamp)
if (isNaN(latestVersionTimestamp as any)) throw new Error(`Invalid latestVersionTimestamp ${a.latestVersionTimestamp}`)
return { ...a, latestVersionTimestamp }
})
}
async getAvailableApp (appId: string): Promise<AppAvailableFull> {