Fix Patches

This commit is contained in:
thororen1234 2026-02-12 15:49:21 -05:00
parent d869df150e
commit 5426f706fb
No known key found for this signature in database
3 changed files with 6 additions and 5 deletions

View file

@ -16,8 +16,8 @@ import { classes } from "@utils/misc";
import definePlugin from "@utils/types";
import { Activity, ApplicationStream, Channel, Message, OnlineStatus, User } from "@vencord/discord-types";
import { MessageFlags } from "@vencord/discord-types/enums";
import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy, findExportedComponentLazy, findLazy } from "@webpack";
import { ChannelStore, MessageStore, Parser, RelationshipStore, SnowflakeUtils, UserStore, useStateFromStores } from "@webpack/common";
import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy, findExportedComponentLazy } from "@webpack";
import { ChannelStore, ExperimentStore, MessageStore, Parser, RelationshipStore, SnowflakeUtils, UserStore, useStateFromStores } from "@webpack/common";
const cl = classNameFactory("vc-message-peek-");
@ -27,7 +27,6 @@ const MessageActions = findByPropsLazy("fetchMessages", "sendMessage");
const hasRelevantActivity: (props: ActivityCheckProps) => boolean = findByCodeLazy(".OFFLINE||", ".INVISIBLE)return!1");
const ActivityText: React.ComponentType<ActivityTextProps> = findComponentByCodeLazy("hasQuest:", "hideEmoji:");
const FavoritesServerExperiment = findLazy(m => m?.definition?.id === "2021-09_favorites_server");
const ONE_HOUR_MS = 60 * 60 * 1000;
@ -216,7 +215,7 @@ function Timestamp({ channel }: { channel: Channel; }) {
if (!lastMessage) return null;
const timestamp = SnowflakeUtils.extractTimestamp(lastMessage.id);
const className = FavoritesServerExperiment.getCurrentConfig().favoritesEnabled ? cl("timestamp-favorites") : cl("timestamp");
const className = ExperimentStore.getUserExperimentBucket("2021-09_favorites_server") >= 1 ? cl("timestamp-favorites") : cl("timestamp");
return <span className={className}>{formatRelativeTime(timestamp)}</span>;
}

View file

@ -91,7 +91,7 @@ export default definePlugin({
{
find: "useCanFavoriteChannel",
replacement: {
match: /\i\.isDM\(\)\|\|\i\.isThread\(\)/,
match: /(?<=\i\.id\)\),\i=)\i\.isThread\(\)/,
replace: "false",
}
},

View file

@ -83,6 +83,7 @@ export let ApplicationCommandIndexStore: t.ApplicationCommandIndexStore;
export let EditMessageStore: t.EditMessageStore;
export let QuestStore: t.QuestStore;
export let PendingReplyStore: GenericStore;
export let ExperimentStore: GenericStore;
/**
* @see jsdoc of {@link t.useStateFromStores}
@ -137,6 +138,7 @@ waitForStore("PopoutWindowStore", m => PopoutWindowStore = m);
waitForStore("ApplicationCommandIndexStore", m => ApplicationCommandIndexStore = m);
waitForStore("EditMessageStore", m => EditMessageStore = m);
waitForStore("PendingReplyStore", m => PendingReplyStore = m);
waitForStore("ExperimentStore", m => ExperimentStore = m);
waitForStore("QuestStore", m => QuestStore = m);
waitForStore("ThemeStore", m => {
ThemeStore = m;