ui: beautiful checkbox for marking to eject drive after backup. broken

This commit is contained in:
Aaron Greenspan
2021-01-06 21:12:28 -07:00
committed by Aiden McClelland
parent 0cd2a32b24
commit a896f4c7a1
4 changed files with 60 additions and 10 deletions

View File

@@ -60,6 +60,19 @@ export class AppModel extends MapSubject<AppInstalledFull> {
)
}
// when an app is installing
watchForBackup (appId: string): Observable<string | undefined> {
const toWatch = super.watch(appId)
if (!toWatch) return of(undefined)
return toWatch.status.pipe(
pairwise(),
filter( ([old, _]) => old === AppStatus.CREATING_BACKUP),
take(1),
mapTo(appId),
)
}
watchForInstallations (appIds: { id: string }[]): Observable<string> {
return merge(...appIds.map(({ id }) => this.watchForInstallation(id))).pipe(
filter(t => !!t),