Skip to content

Commit c94eb40

Browse files
authored
Merge branch 'Davilarek:main' into main
2 parents acb9d52 + 2462fa6 commit c94eb40

File tree

17 files changed

+143
-92
lines changed

17 files changed

+143
-92
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vencord",
33
"private": "true",
4-
"version": "1.10.6",
4+
"version": "1.10.7",
55
"description": "The cutest Discord client mod",
66
"homepage": "https://github.com/Vendicated/Vencord#readme",
77
"bugs": {

scripts/generateReport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ page.on("console", async e => {
225225
plugin,
226226
type,
227227
id,
228-
match: regex.replace(/\[A-Za-z_\$\]\[\\w\$\]\*/g, "\\i"),
228+
match: regex.replace(/\(\?:\[A-Za-z_\$\]\[\\w\$\]\*\)/g, "\\i"),
229229
error: await maybeGetError(e.args()[3])
230230
});
231231

src/components/VencordSettings/PatchHelperTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function FullPatchInput({ setFind, setParsedFind, setMatch, setReplacement }: Fu
247247
}
248248

249249
try {
250-
const parsed = (0, eval)(`(${fullPatch})`) as Patch;
250+
const parsed = (0, eval)(`([${fullPatch}][0])`) as Patch;
251251

252252
if (!parsed.find) throw new Error("No 'find' field");
253253
if (!parsed.replacement) throw new Error("No 'replacement' field");

src/plugins/_core/noTrack.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,7 @@ export default definePlugin({
5959
replace: "$&return;"
6060
}
6161
]
62-
},
63-
{
64-
find: ".installedLogHooks)",
65-
replacement: {
66-
// if getDebugLogging() returns false, the hooks don't get installed.
67-
match: "getDebugLogging(){",
68-
replace: "getDebugLogging(){return false;"
69-
}
70-
},
62+
}
7163
],
7264

7365
startAt: StartAt.Init,

src/plugins/_core/settings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default definePlugin({
6565
replace: (_, sectionTypes, commaOrSemi, elements, element) => `${commaOrSemi} $self.addSettings(${elements}, ${element}, ${sectionTypes}) ${commaOrSemi}`
6666
},
6767
{
68-
match: /({(?=.+?function (\i).{0,120}(\i)=\i\.useMemo.{0,60}return \i\.useMemo\(\(\)=>\i\(\3).+?function\(\){return )\2(?=})/,
68+
match: /({(?=.+?function (\i).{0,160}(\i)=\i\.useMemo.{0,140}return \i\.useMemo\(\(\)=>\i\(\3).+?function\(\){return )\2(?=})/,
6969
replace: (_, rest, settingsHook) => `${rest}$self.wrapSettingsHook(${settingsHook})`
7070
}
7171
]

src/plugins/bdCompatLayer/fakeBdApi.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ export const WebpackHolder = {
148148
first: false,
149149
});
150150
},
151+
get getAllByKeys() {
152+
return this.getAllByProps;
153+
},
151154
getByProps(...props) {
152155
return this.getModule(this.Filters.byProps(...props), {});
153156
},
@@ -283,6 +286,9 @@ class DataWrapper {
283286
}
284287

285288
export const UIHolder = {
289+
alert(title: string, content: any) {
290+
return this.showConfirmationModal(title, content, { cancelText: null });
291+
},
286292
helper() {
287293
console.info("hi");
288294
},

src/plugins/betterFolders/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,16 +275,16 @@ export default definePlugin({
275275
},
276276

277277
makeGuildsBarGuildListFilter(isBetterFolders: boolean) {
278-
try {
279278
return child => {
280279
if (isBetterFolders) {
281-
return child?.props?.["aria-label"] === getIntlMessage("SERVERS");
280+
try {
281+
return child?.props?.["aria-label"] === getIntlMessage("SERVERS");
282+
} catch (e) {
283+
console.error(e);
284+
}
282285
}
283286
return true;
284287
};
285-
} catch {
286-
return true;
287-
}
288288
},
289289

290290
makeGuildsBarTreeFilter(isBetterFolders: boolean) {

src/plugins/consoleJanitor/index.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,34 @@ export default definePlugin({
130130
replace: ""
131131
}
132132
},
133+
// Zustand section
134+
{
135+
find: "[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.",
136+
replacement: [
137+
{
138+
match: /&&console\.warn\("\[DEPRECATED\] Passing a vanilla store will be unsupported in a future version\. Instead use `import { useStore } from 'zustand'`\."\)/,
139+
replace: ""
140+
},
141+
{
142+
match: /console\.warn\("\[DEPRECATED\] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`\. They can be imported from 'zustand\/traditional'\. https:\/\/github\.com\/pmndrs\/zustand\/discussions\/1937"\),/,
143+
replace: ""
144+
}
145+
]
146+
},
147+
{
148+
find: "[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.",
149+
replacement: {
150+
match: /console\.warn\("\[DEPRECATED\] `getStorage`, `serialize` and `deserialize` options are deprecated\. Use `storage` option instead\."\),/,
151+
replace: ""
152+
}
153+
},
154+
{
155+
find: "[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180.",
156+
replacement: {
157+
match: /console\.warn\("\[DEPRECATED\] `context` will be removed in a future version\. Instead use `import { createStore, useStore } from 'zustand'`\. See: https:\/\/github\.com\/pmndrs\/zustand\/discussions\/1180\."\);/,
158+
replace: ""
159+
}
160+
},
133161
// Patches discords generic logger function
134162
{
135163
find: "Σ:",
@@ -147,5 +175,5 @@ export default definePlugin({
147175
replace: "$self.NoopLogger()"
148176
}
149177
}
150-
],
178+
]
151179
});

src/plugins/decor/lib/stores/AuthorizationStore.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const useAuthorizationStore = proxyLazy(() => zustandCreate(
9393
} as AuthorizationState),
9494
{
9595
name: "decor-auth",
96-
getStorage: () => indexedDBStorage,
96+
storage: indexedDBStorage,
9797
partialize: state => ({ tokens: state.tokens }),
9898
onRehydrateStorage: () => state => state?.init()
9999
}

src/plugins/decor/lib/stores/UsersDecorationsStore.ts

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,39 @@ export const useUsersDecorationsStore = proxyLazy(() => zustandCreate((set: any,
9595
} as UsersDecorationsState)));
9696

9797
export function useUserDecorAvatarDecoration(user?: User): AvatarDecoration | null | undefined {
98-
const [decorAvatarDecoration, setDecorAvatarDecoration] = useState<string | null>(user ? useUsersDecorationsStore.getState().getAsset(user.id) ?? null : null);
99-
100-
useEffect(() => {
101-
const destructor = useUsersDecorationsStore.subscribe(
102-
state => {
103-
if (!user) return;
104-
const newDecorAvatarDecoration = state.getAsset(user.id);
105-
if (!newDecorAvatarDecoration) return;
106-
if (decorAvatarDecoration !== newDecorAvatarDecoration) setDecorAvatarDecoration(newDecorAvatarDecoration);
107-
}
108-
);
109-
110-
if (user) {
111-
const { fetch: fetchUserDecorAvatarDecoration } = useUsersDecorationsStore.getState();
112-
fetchUserDecorAvatarDecoration(user.id);
113-
}
114-
return destructor;
115-
}, []);
98+
try {
99+
const [decorAvatarDecoration, setDecorAvatarDecoration] = useState<string | null>(user ? useUsersDecorationsStore.getState().getAsset(user.id) ?? null : null);
100+
101+
useEffect(() => {
102+
const destructor = (() => {
103+
try {
104+
return useUsersDecorationsStore.subscribe(
105+
state => {
106+
if (!user) return;
107+
const newDecorAvatarDecoration = state.getAsset(user.id);
108+
if (!newDecorAvatarDecoration) return;
109+
if (decorAvatarDecoration !== newDecorAvatarDecoration) setDecorAvatarDecoration(newDecorAvatarDecoration);
110+
}
111+
);
112+
} catch {
113+
return () => { };
114+
}
115+
})();
116+
117+
try {
118+
if (user) {
119+
const { fetch: fetchUserDecorAvatarDecoration } = useUsersDecorationsStore.getState();
120+
fetchUserDecorAvatarDecoration(user.id);
121+
}
122+
} catch { }
123+
124+
return destructor;
125+
}, []);
126+
127+
return decorAvatarDecoration ? { asset: decorAvatarDecoration, skuId: SKU_ID } : null;
128+
} catch (e) {
129+
console.error(e);
130+
}
116131

117-
return decorAvatarDecoration ? { asset: decorAvatarDecoration, skuId: SKU_ID } : null;
132+
return null;
118133
}

0 commit comments

Comments
 (0)