mirror of
https://github.com/Vencord/Vesktop.git
synced 2025-02-23 21:55:09 +00:00
fix unregistering not working
This commit is contained in:
parent
eea93b51e3
commit
4b14cd4f6f
2 changed files with 31 additions and 27 deletions
|
@ -14,8 +14,11 @@ import { handle } from "./utils/ipcWrappers";
|
|||
|
||||
let venbind: VenbindType | null = null;
|
||||
export function obtainVenbind() {
|
||||
if (venbind == null) {
|
||||
// TODO?: make binary outputs consistant with node's apis
|
||||
let os: string;
|
||||
let arch: string;
|
||||
|
||||
switch (process.platform) {
|
||||
case "linux":
|
||||
os = "linux";
|
||||
|
@ -26,8 +29,7 @@ export function obtainVenbind() {
|
|||
// os = "darwin";
|
||||
default:
|
||||
return null;
|
||||
};
|
||||
let arch: string;
|
||||
}
|
||||
switch (process.arch) {
|
||||
case "x64":
|
||||
arch = "x86_64";
|
||||
|
@ -37,8 +39,10 @@ export function obtainVenbind() {
|
|||
// break;
|
||||
default:
|
||||
return null;
|
||||
};
|
||||
if (venbind == null) venbind = require(join(STATIC_DIR, `dist/venbind-${os}-${arch}.node`));
|
||||
}
|
||||
|
||||
venbind = require(join(STATIC_DIR, `dist/venbind-${os}-${arch}.node`));
|
||||
}
|
||||
return venbind;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ addPatch({
|
|||
},
|
||||
{
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
match: /inputEventUnregister\((parseInt\(\i,10\))\);else if\(\i\[\i\]\)\{/,
|
||||
replace: "$&$self.unregisterKeybind($1);return;"
|
||||
match: /inputEventUnregister\((parseInt\(\i,10\))\);else/,
|
||||
replace: "$&{$self.unregisterKeybind($1);return;}"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue