MyProcesses always include pairing
This commit is contained in:
parent
8541427b87
commit
5ba45a29be
@ -1509,15 +1509,22 @@ 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
|
// If we're not paired yet, just skip it
|
||||||
|
let pairingProcessId = null;
|
||||||
try {
|
try {
|
||||||
this.getPairingProcessId();
|
pairingProcessId = this.getPairingProcessId();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (!pairingProcessId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const processes = await this.getProcesses();
|
const processes = await this.getProcesses();
|
||||||
|
|
||||||
const newMyProcesses = new Set<string>(this.myProcesses || []);
|
const newMyProcesses = new Set<string>(this.myProcesses || []);
|
||||||
|
// MyProcesses automatically contains pairing process
|
||||||
|
newMyProcesses.add(pairingProcessId);
|
||||||
for (const [processId, process] of Object.entries(processes)) {
|
for (const [processId, process] of Object.entries(processes)) {
|
||||||
// We use myProcesses attribute to not reevaluate all processes everytime
|
// We use myProcesses attribute to not reevaluate all processes everytime
|
||||||
if (newMyProcesses.has(processId)) {
|
if (newMyProcesses.has(processId)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user