Don't post SCAN message when no process
This commit is contained in:
parent
570f98c51c
commit
dc231ba982
@ -147,7 +147,9 @@ export class Database {
|
|||||||
const activeWorker = this.serviceWorkerRegistration.active || (await this.waitForServiceWorkerActivation(this.serviceWorkerRegistration));
|
const activeWorker = this.serviceWorkerRegistration.active || (await this.waitForServiceWorkerActivation(this.serviceWorkerRegistration));
|
||||||
const service = await Services.getInstance();
|
const service = await Services.getInstance();
|
||||||
const payload = await service.getMyProcesses();
|
const payload = await service.getMyProcesses();
|
||||||
activeWorker?.postMessage({ type: 'SCAN', payload });
|
if (payload.length != 0) {
|
||||||
|
activeWorker?.postMessage({ type: 'SCAN', payload });
|
||||||
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Service Worker registration failed:', error);
|
console.error('Service Worker registration failed:', error);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user