mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
remove not needed subs
This commit is contained in:
committed by
Aiden McClelland
parent
fbe1b26a55
commit
c680a3b830
@@ -8,17 +8,10 @@ import { PatchDbModel } from '../services/patch-db/patch-db.service'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class MaintenanceGuard implements CanActivate, CanActivateChild {
|
||||
serverStatus: ServerStatus
|
||||
|
||||
constructor (
|
||||
private readonly router: Router,
|
||||
private readonly patch: PatchDbModel,
|
||||
) {
|
||||
this.patch.watch$('server-info', 'status')
|
||||
.pipe(
|
||||
tap(status => this.serverStatus = status),
|
||||
).subscribe()
|
||||
}
|
||||
) { }
|
||||
|
||||
canActivate (): boolean {
|
||||
return this.runServerStatusCheck()
|
||||
@@ -29,7 +22,7 @@ export class MaintenanceGuard implements CanActivate, CanActivateChild {
|
||||
}
|
||||
|
||||
private runServerStatusCheck (): boolean {
|
||||
if ([ServerStatus.Updating, ServerStatus.BackingUp].includes(this.serverStatus)) {
|
||||
if ([ServerStatus.Updating, ServerStatus.BackingUp].includes(this.patch.data['server-info']?.status)) {
|
||||
this.router.navigate(['/maintenance'], { replaceUrl: true })
|
||||
return false
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user