mirror of
https://github.com/Equicord/Equicord.git
synced 2025-07-01 17:34:24 -04:00
Webpack: Make findStore compatible with libdiscore stores
This commit is contained in:
parent
e447dec67b
commit
b4dddfda47
2 changed files with 40 additions and 1 deletions
|
@ -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 });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue