mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-08-06 13:18:27 +02:00
22 lines
688 B
TypeScript
22 lines
688 B
TypeScript
import { BxEventBus } from "./bx-event-bus";
|
|
import { GhPagesUtils } from "./gh-pages";
|
|
|
|
export class LocalCoOpManager {
|
|
private static instance: LocalCoOpManager;
|
|
public static getInstance = () => LocalCoOpManager.instance ?? (LocalCoOpManager.instance = new LocalCoOpManager());
|
|
|
|
private supportedIds: Set<string>;
|
|
|
|
constructor() {
|
|
BxEventBus.Script.once('list.localCoOp.updated', e => {
|
|
this.supportedIds = e.ids;
|
|
});
|
|
this.supportedIds = GhPagesUtils.getLocalCoOpList();
|
|
console.log('this.supportedIds', this.supportedIds);
|
|
}
|
|
|
|
isSupported(productId: string) {
|
|
return this.supportedIds.has(productId);
|
|
}
|
|
}
|