MyProcesses always include pairing

This commit is contained in:
Sosthene 2025-08-08 08:27:46 +02:00
parent 8541427b87
commit 5ba45a29be

View File

@ -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)) {