mirror of
https://github.com/Equicord/Equicord.git
synced 2025-02-24 00:59:09 -05:00
Update Companion
This commit is contained in:
parent
408e837b1f
commit
3aa5a5f35f
2 changed files with 7 additions and 8 deletions
|
@ -136,8 +136,6 @@ export function initWs(isManual = false) {
|
||||||
ws.send(JSON.stringify(toSend));
|
ws.send(JSON.stringify(toSend));
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Received Message:", d.type, "\n", d.data);
|
|
||||||
|
|
||||||
switch (d.type) {
|
switch (d.type) {
|
||||||
case "disable": {
|
case "disable": {
|
||||||
const m = d.data;
|
const m = d.data;
|
||||||
|
@ -176,7 +174,7 @@ export function initWs(isManual = false) {
|
||||||
case "search": {
|
case "search": {
|
||||||
let moduleId: number;
|
let moduleId: number;
|
||||||
if (m.findType === "string")
|
if (m.findType === "string")
|
||||||
moduleId = +findModuleId([m.idOrSearch.toString()]);
|
moduleId = +findModuleId([canonicalizeMatch(m.idOrSearch.toString())]);
|
||||||
else
|
else
|
||||||
moduleId = +findModuleId(mkRegexFind(m.idOrSearch));
|
moduleId = +findModuleId(mkRegexFind(m.idOrSearch));
|
||||||
const p = extractOrThrow(moduleId);
|
const p = extractOrThrow(moduleId);
|
||||||
|
@ -217,7 +215,7 @@ export function initWs(isManual = false) {
|
||||||
type: "extract",
|
type: "extract",
|
||||||
ok: true,
|
ok: true,
|
||||||
data: {
|
data: {
|
||||||
module: extractModule(m.idOrSearch),
|
module: extractModule(m.idOrSearch, m.usePatched ?? undefined),
|
||||||
moduleNumber: m.idOrSearch,
|
moduleNumber: m.idOrSearch,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -227,7 +225,7 @@ export function initWs(isManual = false) {
|
||||||
case "search": {
|
case "search": {
|
||||||
let moduleId;
|
let moduleId;
|
||||||
if (m.findType === "string")
|
if (m.findType === "string")
|
||||||
moduleId = +findModuleId([m.idOrSearch.toString()]);
|
moduleId = +findModuleId([canonicalizeMatch(m.idOrSearch.toString())]);
|
||||||
|
|
||||||
else
|
else
|
||||||
moduleId = +findModuleId(mkRegexFind(m.idOrSearch));
|
moduleId = +findModuleId(mkRegexFind(m.idOrSearch));
|
||||||
|
@ -235,7 +233,7 @@ export function initWs(isManual = false) {
|
||||||
type: "extract",
|
type: "extract",
|
||||||
ok: true,
|
ok: true,
|
||||||
data: {
|
data: {
|
||||||
module: extractModule(moduleId),
|
module: extractModule(moduleId, m.usePatched ?? undefined),
|
||||||
moduleNumber: moduleId
|
moduleNumber: moduleId
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -445,7 +443,6 @@ interface AllModulesNotiProps {
|
||||||
const AllModulesNoti = ErrorBoundary.wrap(function ({ done, close }: AllModulesNotiProps) {
|
const AllModulesNoti = ErrorBoundary.wrap(function ({ done, close }: AllModulesNotiProps) {
|
||||||
const [state, setState] = useState<0 | 1 | -1>(0);
|
const [state, setState] = useState<0 | 1 | -1>(0);
|
||||||
done.then(setState.bind(null, 1)).catch(setState.bind(null, -1));
|
done.then(setState.bind(null, 1)).catch(setState.bind(null, -1));
|
||||||
console.log("test");
|
|
||||||
if (state === 1) setTimeout(close, 5000);
|
if (state === 1) setTimeout(close, 5000);
|
||||||
return (<>
|
return (<>
|
||||||
{state === 0 && "Loading lazy modules, restarting could lead to errors"}
|
{state === 0 && "Loading lazy modules, restarting could lead to errors"}
|
||||||
|
|
|
@ -27,7 +27,9 @@ export type SearchData =
|
||||||
);
|
);
|
||||||
|
|
||||||
export type FindOrSearchData =
|
export type FindOrSearchData =
|
||||||
| SearchData
|
| (SearchData & {
|
||||||
|
usePatched: boolean | null;
|
||||||
|
})
|
||||||
| ({
|
| ({
|
||||||
extractType: "find";
|
extractType: "find";
|
||||||
} & _PrefixKeys<_CapitalizeKeys<FindData>, "find">);
|
} & _PrefixKeys<_CapitalizeKeys<FindData>, "find">);
|
||||||
|
|
Loading…
Add table
Reference in a new issue