diff --git a/src/equicordplugins/modalFade/index.tsx b/src/equicordplugins/modalFade/index.tsx index b2304a95..ccc3b139 100644 --- a/src/equicordplugins/modalFade/index.tsx +++ b/src/equicordplugins/modalFade/index.tsx @@ -14,7 +14,7 @@ import type { StoreApi, UseBoundStore } from "zustand"; type Modal = { Layer?: any, instant?: boolean, - backdropStyle?: "SUBTLE" | "DARK" | "BLUR", + backdropStyle?: "SUBTLE" | "DARK" | "BLUR", "IMMERSIVE", }; const { useModalContext, useModalsStore } = proxyLazy(() => Forms as any as { @@ -26,8 +26,6 @@ const { useModalContext, useModalsStore } = proxyLazy(() => Forms as any as { }); const { animated, useSpring, useTransition } = findByPropsLazy("a", "animated", "useTransition"); -// This doesn't seem to be necessary -// const { default: AppLayer } = findByPropsLazy("AppLayerContainer", "AppLayerProvider"); const ANIMS = { SUBTLE: { @@ -42,6 +40,10 @@ const ANIMS = { off: { opacity: 1, filter: "blur(0px)" }, on: { opacity: 0.7, filter: "blur(8px)" }, }, + IMMERSIVE: { + off: { opacity: 1 }, + on: { opacity: 0.7 } + } }; export default definePlugin({ diff --git a/src/plugins/_core/noTrack.ts b/src/plugins/_core/noTrack.ts index 8d6a1e76..f9d04226 100644 --- a/src/plugins/_core/noTrack.ts +++ b/src/plugins/_core/noTrack.ts @@ -60,14 +60,17 @@ export default definePlugin({ } ] }, - { - find: ".installedLogHooks)", + // TEMP Work until Vencord Fix + ...[ + ".DEBUG_LOGGING)", + ".inputDeviceId)||" + ].map(find => ({ + find, replacement: { - // if getDebugLogging() returns false, the hooks don't get installed. match: "getDebugLogging(){", replace: "getDebugLogging(){return false;" } - }, + })), ], startAt: StartAt.Init, diff --git a/src/plugins/consoleJanitor/index.ts b/src/plugins/consoleJanitor/index.ts index 9419749b..4b3193ed 100644 --- a/src/plugins/consoleJanitor/index.ts +++ b/src/plugins/consoleJanitor/index.ts @@ -154,5 +154,5 @@ export default definePlugin({ replace: "$self.NoopLogger()" } } - ], + ] }); diff --git a/src/plugins/decor/lib/stores/AuthorizationStore.tsx b/src/plugins/decor/lib/stores/AuthorizationStore.tsx index ba71da99..7f3468fd 100644 --- a/src/plugins/decor/lib/stores/AuthorizationStore.tsx +++ b/src/plugins/decor/lib/stores/AuthorizationStore.tsx @@ -93,7 +93,7 @@ export const useAuthorizationStore = proxyLazy(() => zustandCreate( } as AuthorizationState), { name: "decor-auth", - getStorage: () => indexedDBStorage, + storage: indexedDBStorage, partialize: state => ({ tokens: state.tokens }), onRehydrateStorage: () => state => state?.init() } diff --git a/src/plugins/messageLogger/index.tsx b/src/plugins/messageLogger/index.tsx index e4d8ca74..e6a61ef8 100644 --- a/src/plugins/messageLogger/index.tsx +++ b/src/plugins/messageLogger/index.tsx @@ -19,7 +19,7 @@ import { getIntlMessage } from "@utils/discord"; import { Logger } from "@utils/Logger"; import { classes } from "@utils/misc"; import definePlugin, { OptionType } from "@utils/types"; -import { findByCodeLazy, findByPropsLazy } from "@webpack"; +import { findByPropsLazy } from "@webpack"; import { ChannelStore, FluxDispatcher, Menu, MessageStore, Parser, SelectedChannelStore, Timestamp, UserStore, useStateFromStores } from "@webpack/common"; import { Message } from "discord-types/general"; @@ -33,12 +33,7 @@ interface MLMessage extends Message { firstEditTimestamp?: Date; } -const styles = findByPropsLazy( - "edited", - "communicationDisabled", - "isSystemMessage", -); -const getMessage = findByCodeLazy('replace(/^\\n+|\\n+$/g,"")'); +const styles = findByPropsLazy("edited", "communicationDisabled", "isSystemMessage"); function addDeleteStyle() { if (Settings.plugins.MessageLogger.deleteStyle === "text") { @@ -348,35 +343,33 @@ export default definePlugin({ ); }, - Messages: { - // DELETED_MESSAGE_COUNT: getMessage("{count, plural, =0 {No deleted messages} one {{count} deleted message} other {{count} deleted messages}}") - // TODO: find a better way to generate intl messages - DELETED_MESSAGE_COUNT: () => ({ - ast: [[ - 6, - "count", - { - "=0": ["No deleted messages"], - one: [ - [ - 1, - "count" - ], - " deleted message" + // DELETED_MESSAGE_COUNT: getMessage("{count, plural, =0 {No deleted messages} one {{count} deleted message} other {{count} deleted messages}}") + // TODO: Find a better way to generate intl messages + DELETED_MESSAGE_COUNT: () => ({ + ast: [[ + 6, + "count", + { + "=0": ["No deleted messages"], + one: [ + [ + 1, + "count" ], - other: [ - [ - 1, - "count" - ], - " deleted messages" - ] - }, - 0, - "cardinal" - ]] - }) - }, + " deleted message" + ], + other: [ + [ + 1, + "count" + ], + " deleted messages" + ] + }, + 0, + "cardinal" + ]] + }), patches: [ { @@ -572,8 +565,7 @@ export default definePlugin({ }, { match: /(\i).type===\i\.\i\.MESSAGE_GROUP_BLOCKED\?.*?:/, - replace: - '$&$1.type==="MESSAGE_GROUP_DELETED"?$self.Messages.DELETED_MESSAGE_COUNT:', + replace: '$&$1.type==="MESSAGE_GROUP_DELETED"?$self.DELETED_MESSAGE_COUNT:', }, ], predicate: () => Settings.plugins.MessageLogger.collapseDeleted, diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index f8454066..47df4304 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -28,8 +28,8 @@ import { Message } from "discord-types/general"; const RelationshipStore = findByPropsLazy("getRelationships", "isBlocked"); interface MessageDeleteProps { - // i18n message i18n.t["+FcYMz"] if deleted, with args - collapsedReason: () => any + // Internal intl message for BLOCKED_MESSAGE_COUNT + collapsedReason: () => any; } export default definePlugin({ diff --git a/src/plugins/relationshipNotifier/utils.ts b/src/plugins/relationshipNotifier/utils.ts index 053cff83..84e812a7 100644 --- a/src/plugins/relationshipNotifier/utils.ts +++ b/src/plugins/relationshipNotifier/utils.ts @@ -50,6 +50,8 @@ async function runMigrations() { export async function syncAndRunChecks() { await runMigrations(); + if (UserStore.getCurrentUser() == null) return; + const [oldGuilds, oldGroups, oldFriends] = await DataStore.getMany([ guildsKey(), groupsKey(), diff --git a/src/plugins/typingIndicator/index.tsx b/src/plugins/typingIndicator/index.tsx index ea92875f..4f1a6a0e 100644 --- a/src/plugins/typingIndicator/index.tsx +++ b/src/plugins/typingIndicator/index.tsx @@ -24,7 +24,7 @@ import { Devs } from "@utils/constants"; import { getIntlMessage } from "@utils/discord"; import definePlugin, { OptionType } from "@utils/types"; import { findComponentByCodeLazy, findExportedComponentLazy, findStoreLazy } from "@webpack"; -import { ChannelStore, GuildMemberStore, RelationshipStore, SelectedChannelStore, Tooltip, UserStore, useStateFromStores } from "@webpack/common"; +import { GuildMemberStore, RelationshipStore, SelectedChannelStore, Tooltip, UserStore, useStateFromStores } from "@webpack/common"; import { buildSeveralUsers } from "../typingTweaks"; @@ -44,7 +44,7 @@ function getDisplayName(guildId: string, userId: string) { return GuildMemberStore.getNick(guildId, userId) ?? (user as any).globalName ?? user.username; } -function TypingIndicator({ channelId }: { channelId: string; }) { +function TypingIndicator({ channelId, guildId }: { channelId: string; guildId: string; }) { const typingUsers: Record = useStateFromStores( [TypingStore], () => ({ ...TypingStore.getTypingUsers(channelId) as Record }), @@ -57,7 +57,6 @@ function TypingIndicator({ channelId }: { channelId: string; }) { } ); const currentChannelId: string = useStateFromStores([SelectedChannelStore], () => SelectedChannelStore.getChannelId()); - const guildId = ChannelStore.getChannel(channelId).guild_id; if (!settings.store.includeMutedChannels) { const isChannelMuted = UserGuildSettingsStore.isChannelMuted(guildId, channelId); @@ -165,7 +164,7 @@ export default definePlugin({ find: "UNREAD_IMPORTANT:", replacement: { match: /\.name\),.{0,120}\.children.+?:null(?<=,channel:(\i).+?)/, - replace: "$&,$self.TypingIndicator($1.id)" + replace: "$&,$self.TypingIndicator($1.id,$1.getGuildId())" } }, // Theads @@ -174,14 +173,14 @@ export default definePlugin({ find: "M11 9H4C2.89543 9 2 8.10457 2 7V1C2 0.447715 1.55228 0 1 0C0.447715 0 0 0.447715 0 1V7C0 9.20914 1.79086 11 4 11H11C11.5523 11 12 10.5523 12 10C12 9.44771 11.5523 9 11 9Z", replacement: { match: /mentionsCount:\i.+?null(?<=channel:(\i).+?)/, - replace: "$&,$self.TypingIndicator($1.id)" + replace: "$&,$self.TypingIndicator($1.id,$1.getGuildId())" } } ], - TypingIndicator: (channelId: string) => ( + TypingIndicator: (channelId: string, guildId: string) => ( - + ), }); diff --git a/src/plugins/typingTweaks/index.tsx b/src/plugins/typingTweaks/index.tsx index 2b529373..e2bbb4bc 100644 --- a/src/plugins/typingTweaks/index.tsx +++ b/src/plugins/typingTweaks/index.tsx @@ -129,14 +129,22 @@ export default definePlugin({ buildSeveralUsers, mutateChildren(props: any, users: User[], children: any) { - if (!Array.isArray(children)) return children; + try { + if (!Array.isArray(children)) { + return children; + } - let element = 0; + let element = 0; - return children.map(c => - c.type === "strong" || (typeof c !== "string" && !React.isValidElement(c)) - ? - : c - ); + return children.map(c => + c.type === "strong" || (typeof c !== "string" && !React.isValidElement(c)) + ? + : c + ); + } catch (e) { + console.error(e); + } + + return children; } });