Don't throw error if unpaired while trying to get my processes
This commit is contained in:
parent
989263d44a
commit
189bd3d252
@ -147,7 +147,7 @@ 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();
|
||||||
if (payload!.length != 0) {
|
if (payload && payload.length != 0) {
|
||||||
activeWorker?.postMessage({ type: 'SCAN', payload });
|
activeWorker?.postMessage({ type: 'SCAN', payload });
|
||||||
}
|
}
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
@ -1340,6 +1340,12 @@ export default class Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async getMyProcesses(): Promise<string[] | null> {
|
public async getMyProcesses(): Promise<string[] | null> {
|
||||||
|
// If we're not paired yet, just skip it
|
||||||
|
try {
|
||||||
|
this.getPairingProcessId();
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
const processes = await this.getProcesses();
|
const processes = await this.getProcesses();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user