fix broken patches
This commit is contained in:
@@ -8,7 +8,7 @@ import { addPatch } from "./shared";
|
||||
|
||||
addPatch({
|
||||
patches: [
|
||||
// Discord Web blocks the devtools keybin on mac specifically, disable that
|
||||
// Discord Web blocks the devtools key-bind on mac specifically, disable that
|
||||
{
|
||||
find: '"mod+alt+i"',
|
||||
replacement: {
|
||||
|
||||
@@ -11,13 +11,13 @@ addPatch({
|
||||
{
|
||||
find: "lastOutputSystemDevice.justChanged",
|
||||
replacement: {
|
||||
match: /(\i)\.\i\.getState\(\).neverShowModal/,
|
||||
match: /\.getState\(\)\.neverShowModal(?=.{0,50}?(\i)\.lastDeviceConnected)/,
|
||||
replace: "$& || $self.shouldIgnoreDevice($1)"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
shouldIgnoreDevice(state: any) {
|
||||
return Object.keys(state?.default?.lastDeviceConnected ?? {})?.[0] === "vencord-screen-share";
|
||||
return Object.keys(state.lastDeviceConnected ?? {})[0] === "vencord-screen-share";
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,13 +11,13 @@ addPatch({
|
||||
{
|
||||
find: 'setSinkId"in',
|
||||
replacement: {
|
||||
match: /return (\i)\?navigator\.mediaDevices\.enumerateDevices/,
|
||||
replace: "return $1 ? $self.filteredDevices"
|
||||
match: /navigator\.mediaDevices\.enumerateDevices\(\)/,
|
||||
replace: "$self.getFilteredDevices()"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
async filteredDevices() {
|
||||
async getFilteredDevices() {
|
||||
const original = await navigator.mediaDevices.enumerateDevices();
|
||||
return original.filter(x => x.label !== "vencord-screen-share");
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ import { addPatch } from "./shared";
|
||||
addPatch({
|
||||
patches: [
|
||||
{
|
||||
find: ".STREAMING_AUTO_STREAMER_MODE,",
|
||||
find: ".STREAMING_AUTO_STREAMER_MODE,{",
|
||||
replacement: {
|
||||
// remove if (platformEmbedded) check from streamer mode toggle
|
||||
match: /(?<=usePredicate.{0,20}?return )\i\.\i/g,
|
||||
match: /(?<=\.STREAMING_AUTO_STREAMER_MODE,\{.{0,300}?usePredicate:.{0,20}return )\i\.\i(?=\})/g,
|
||||
replace: "true"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user