Webpack: Make findStore compatible with libdiscore stores

This commit is contained in:
Nuckyz 2025-05-16 17:07:33 -03:00
parent e447dec67b
commit b4dddfda47
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
2 changed files with 40 additions and 1 deletions

View file

@ -468,6 +468,29 @@ export function findStore(name: StoreNameFilter) {
}
}
try {
const getLibdiscore = findByCode("libdiscoreWasm is not initialized");
const libdiscoreExports = getLibdiscore();
for (const libdiscoreExportName in libdiscoreExports) {
if (!libdiscoreExportName.endsWith("Store")) {
continue;
}
const storeName = libdiscoreExportName;
const store = libdiscoreExports[storeName];
if (storeName === name) {
res = store;
}
if (fluxStores[storeName] == null) {
fluxStores[storeName] = store;
}
}
} catch { }
if (res == null) {
res = find(filters.byStoreName(name), { isIndirect: true });
}