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));
|
||||
}
|
||||
|
||||
logger.info("Received Message:", d.type, "\n", d.data);
|
||||
|
||||
switch (d.type) {
|
||||
case "disable": {
|
||||
const m = d.data;
|
||||
|
@ -176,7 +174,7 @@ export function initWs(isManual = false) {
|
|||
case "search": {
|
||||
let moduleId: number;
|
||||
if (m.findType === "string")
|
||||
moduleId = +findModuleId([m.idOrSearch.toString()]);
|
||||
moduleId = +findModuleId([canonicalizeMatch(m.idOrSearch.toString())]);
|
||||
else
|
||||
moduleId = +findModuleId(mkRegexFind(m.idOrSearch));
|
||||
const p = extractOrThrow(moduleId);
|
||||
|
@ -217,7 +215,7 @@ export function initWs(isManual = false) {
|
|||
type: "extract",
|
||||
ok: true,
|
||||
data: {
|
||||
module: extractModule(m.idOrSearch),
|
||||
module: extractModule(m.idOrSearch, m.usePatched ?? undefined),
|
||||
moduleNumber: m.idOrSearch,
|
||||
},
|
||||
});
|
||||
|
@ -227,7 +225,7 @@ export function initWs(isManual = false) {
|
|||
case "search": {
|
||||
let moduleId;
|
||||
if (m.findType === "string")
|
||||
moduleId = +findModuleId([m.idOrSearch.toString()]);
|
||||
moduleId = +findModuleId([canonicalizeMatch(m.idOrSearch.toString())]);
|
||||
|
||||
else
|
||||
moduleId = +findModuleId(mkRegexFind(m.idOrSearch));
|
||||
|
@ -235,7 +233,7 @@ export function initWs(isManual = false) {
|
|||
type: "extract",
|
||||
ok: true,
|
||||
data: {
|
||||
module: extractModule(moduleId),
|
||||
module: extractModule(moduleId, m.usePatched ?? undefined),
|
||||
moduleNumber: moduleId
|
||||
},
|
||||
});
|
||||
|
@ -445,7 +443,6 @@ interface AllModulesNotiProps {
|
|||
const AllModulesNoti = ErrorBoundary.wrap(function ({ done, close }: AllModulesNotiProps) {
|
||||
const [state, setState] = useState<0 | 1 | -1>(0);
|
||||
done.then(setState.bind(null, 1)).catch(setState.bind(null, -1));
|
||||
console.log("test");
|
||||
if (state === 1) setTimeout(close, 5000);
|
||||
return (<>
|
||||
{state === 0 && "Loading lazy modules, restarting could lead to errors"}
|
||||
|
|
|
@ -27,7 +27,9 @@ export type SearchData =
|
|||
);
|
||||
|
||||
export type FindOrSearchData =
|
||||
| SearchData
|
||||
| (SearchData & {
|
||||
usePatched: boolean | null;
|
||||
})
|
||||
| ({
|
||||
extractType: "find";
|
||||
} & _PrefixKeys<_CapitalizeKeys<FindData>, "find">);
|
||||
|
|
Loading…
Add table
Reference in a new issue