mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-07 21:58:27 +02:00
Use Set() for local co-op list
This commit is contained in:
@@ -5,17 +5,17 @@ export class LocalCoOpManager {
|
||||
private static instance: LocalCoOpManager;
|
||||
public static getInstance = () => LocalCoOpManager.instance ?? (LocalCoOpManager.instance = new LocalCoOpManager());
|
||||
|
||||
private supportedIds: string[] = [];
|
||||
private supportedIds: Set<string>;
|
||||
|
||||
constructor() {
|
||||
BxEventBus.Script.once('list.localCoOp.updated', e => {
|
||||
this.supportedIds = Object.keys(e.data.data);
|
||||
console.log('supportedIds', this.supportedIds);
|
||||
this.supportedIds = e.ids;
|
||||
});
|
||||
GhPagesUtils.getLocalCoOpList();
|
||||
this.supportedIds = GhPagesUtils.getLocalCoOpList();
|
||||
console.log('this.supportedIds', this.supportedIds);
|
||||
}
|
||||
|
||||
isSupported(productId: string) {
|
||||
return this.supportedIds.includes(productId);
|
||||
return this.supportedIds.has(productId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user