Show local co-op icon in game card

This commit is contained in:
redphx
2025-01-02 21:39:27 +07:00
parent 9862f794cf
commit 90f89a0244
14 changed files with 287 additions and 14 deletions

View File

@@ -83,4 +83,24 @@ export class GhPagesUtils {
const customList = JSON.parse(window.localStorage.getItem(key) || '[]');
return customList;
}
static getLocalCoOpList() {
const supportedSchema = 1;
const key = StorageKey.LIST_LOCAL_CO_OP;
NATIVE_FETCH(GhPagesUtils.getUrl('local-co-op/ids.json'))
.then(response => response.json())
.then(json => {
if (json.$schemaVersion === supportedSchema) {
window.localStorage.setItem(key, JSON.stringify(json));
BxEventBus.Script.emit('list.localCoOp.updated', { data: json });
} else {
window.localStorage.removeItem(key);
BxEventBus.Script.emit('list.localCoOp.updated', { data: { data: {} } });
}
});
const customList = JSON.parse(window.localStorage.getItem(key) || '[]');
return customList;
}
}