Skip to content

Commit e740d22

Browse files
committed
fix: do not check for update in dev env
1 parent 4f185bd commit e740d22

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/app/services/app-update.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ApplicationRef, inject, Injectable } from '@angular/core'
22
import { SwUpdate, VersionReadyEvent } from '@angular/service-worker'
33
import { BehaviorSubject, concat, filter, first, interval } from 'rxjs'
4+
import { environment } from '../../environments/environment'
45

56
@Injectable({
67
providedIn: 'root',
@@ -21,6 +22,9 @@ export class AppUpdate {
2122

2223
scheduledEvent$.subscribe(async () => {
2324
try {
25+
if (!environment.production) {
26+
return
27+
}
2428
console.info(`[${new Date().toLocaleString()}] Checking for updates...`)
2529
const updateFound = await this.swu.checkForUpdate()
2630
this.updateFound.next(updateFound)

0 commit comments

Comments
 (0)