mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-30 20:09:50 +03:00
fix: update check for new updates to not show banner if app is up to date
This commit is contained in:
parent
14fd810a54
commit
16ab8d71c8
@ -18,7 +18,8 @@ import {
|
||||
catchError,
|
||||
of,
|
||||
startWith,
|
||||
combineLatestWith
|
||||
combineLatestWith,
|
||||
tap
|
||||
} from 'rxjs';
|
||||
|
||||
export type Update = { version?: string; status?: UpdateStatus } | undefined;
|
||||
@ -42,6 +43,7 @@ export class UpdaterService {
|
||||
|
||||
this.update$ = this.reload$.pipe(
|
||||
switchMap(() => interval(60 * 1000).pipe(startWith(0))),
|
||||
tap(() => this.status$.next(undefined)),
|
||||
switchMap(() =>
|
||||
from(checkUpdate()).pipe(
|
||||
timeout(10000), // In dev mode the promise hangs indefinitely.
|
||||
@ -61,7 +63,7 @@ export class UpdaterService {
|
||||
}),
|
||||
shareReplay(1)
|
||||
);
|
||||
// this.update$ = of({ version: '1.0.0', status: 'DONE' });
|
||||
this.update$ = of({ version: '1.0.0', status: 'UPTODATE' });
|
||||
}
|
||||
|
||||
async install() {
|
||||
|
@ -10,7 +10,7 @@
|
||||
$: update$ = updaterService.update$;
|
||||
</script>
|
||||
|
||||
{#if $update$?.version}
|
||||
{#if $update$?.version && $update$.status != 'UPTODATE'}
|
||||
<div class="update-banner" class:busy={$update$?.status == 'PENDING'}>
|
||||
<div class="img">
|
||||
<div class="circle-img">
|
||||
|
Loading…
Reference in New Issue
Block a user