Merge branch 'dev'
This commit is contained in:
commit
cdda5392d7
4 changed files with 30 additions and 14 deletions
|
|
@ -21,7 +21,7 @@ import { createAndAppendStyle } from "@utils/css";
|
|||
import { ThemeStore } from "@vencord/discord-types";
|
||||
import { PopoutWindowStore } from "@webpack/common";
|
||||
|
||||
import { userStyleRootNode, vencordRootNode } from "./Styles";
|
||||
import { coreStyleRootNode, managedStyleRootNode, userStyleRootNode, vencordRootNode } from "./Styles";
|
||||
|
||||
let style: HTMLStyleElement;
|
||||
let themesStyle: HTMLStyleElement;
|
||||
|
|
@ -83,14 +83,23 @@ async function initThemes() {
|
|||
|
||||
function applyToPopout(popoutWindow: Window | undefined, key: string) {
|
||||
if (!popoutWindow?.document) return;
|
||||
// skip game overlay cuz it needs to stay transparent, themes broke it
|
||||
if (key === "DISCORD_OutOfProcessOverlay") return;
|
||||
|
||||
const doc = popoutWindow.document;
|
||||
|
||||
doc.querySelector("vencord-root")?.remove();
|
||||
|
||||
doc.documentElement.appendChild(vencordRootNode.cloneNode(true));
|
||||
const clonedRoot = vencordRootNode.cloneNode(false) as HTMLElement;
|
||||
|
||||
clonedRoot.append(
|
||||
coreStyleRootNode.cloneNode(true),
|
||||
managedStyleRootNode.cloneNode(true)
|
||||
);
|
||||
|
||||
if (key !== "DISCORD_OutOfProcessOverlay") {
|
||||
clonedRoot.append(userStyleRootNode.cloneNode(true));
|
||||
}
|
||||
|
||||
doc.documentElement.appendChild(clonedRoot);
|
||||
}
|
||||
|
||||
function updatePopoutWindows() {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import { openPluginModal } from "@components/settings";
|
|||
import { EquicordDevs } from "@utils/constants";
|
||||
import { copyToClipboard } from "@utils/index";
|
||||
import definePlugin, { PluginNative, StartAt } from "@utils/types";
|
||||
import { onceReady } from "@webpack";
|
||||
import { findStoreLazy, onceReady } from "@webpack";
|
||||
import { ContextMenuApi, Menu, NavigationRouter, RestAPI, useEffect, useState } from "@webpack/common";
|
||||
import { JSX } from "react";
|
||||
|
||||
|
|
@ -23,6 +23,7 @@ import { addIgnoredQuest, addRerenderCallback, autoFetchCompatible, fetchAndAler
|
|||
import { ActiveQuestIntervalsMap, ExcludedQuestMap, GuildlessServerListItem, Quest, QuestIcon, QuestMap, QuestStatus, QuestTaskType, RGB } from "./utils/components";
|
||||
import { adjustRGB, decimalToRGB, fetchAndDispatchQuests, formatLowerBadge, getFormattedNow, getIgnoredQuestIDs, getQuestProgress, getQuestStatus, getQuestTarget, getQuestTask, isDarkish, leftClick, middleClick, normalizeQuestName, q, QuestifyLogger, questPath, QuestsStore, refreshQuest, reportPlayGameQuestProgress, reportVideoQuestProgress, rightClick, setIgnoredQuestIDs, videoQuestLeeway, waitUntilEnrolled } from "./utils/misc";
|
||||
|
||||
const AuthorizedAppsStore = findStoreLazy("AuthorizedAppsStore");
|
||||
let initialQuestDataFetched = false;
|
||||
const QuestifyNative = VencordNative.pluginHelpers.Questify as PluginNative<typeof import("./native")>;
|
||||
const patchedMobileQuests = new Set<string>();
|
||||
|
|
@ -852,7 +853,6 @@ async function startAchievementActivityProgressTracking(quest: Quest, target: {
|
|||
if (!result.success) {
|
||||
const errorReason = result.error || "An error occurred while completing the Quest.";
|
||||
QuestifyLogger.error(`[${getFormattedNow()}] Failed to complete Quest ${questName}:`, errorReason);
|
||||
return;
|
||||
} else {
|
||||
QuestifyLogger.info(`[${getFormattedNow()}] Quest ${questName} completed.`);
|
||||
|
||||
|
|
@ -865,6 +865,20 @@ async function startAchievementActivityProgressTracking(quest: Quest, target: {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const deauthToken = AuthorizedAppsStore.getNewestTokenForApplication(appID)?.id;
|
||||
|
||||
if (!deauthToken) {
|
||||
throw new Error("Deauthorization token not found.");
|
||||
}
|
||||
|
||||
await RestAPI.del({
|
||||
url: `/oauth2/tokens/${deauthToken}/`,
|
||||
});
|
||||
} catch (error) {
|
||||
QuestifyLogger.error(`[${getFormattedNow()}] Failed to deauthorize application for Quest ${questName}:`, error);
|
||||
}
|
||||
}
|
||||
|
||||
function canQuestAutoComplete(quest: Quest): boolean {
|
||||
|
|
|
|||
|
|
@ -165,13 +165,6 @@ export default definePlugin({
|
|||
match: /(\i)\.buildLayout\(\)(?=\.map)/,
|
||||
replace: "$self.buildLayout($1)"
|
||||
}
|
||||
},
|
||||
{
|
||||
find: "getWebUserSettingFromSection",
|
||||
replacement: {
|
||||
match: /new Map\(\[(?=\[.{0,10}\.ACCOUNT,.{0,10}\.ACCOUNT_PANEL)/,
|
||||
replace: "new Map([...$self.getSettingsSectionMappings(),"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ export default definePlugin({
|
|||
<Tooltip text={text} position="right">
|
||||
{({ onMouseEnter, onMouseLeave }) => (
|
||||
<div
|
||||
id={cl("-indicator-items")}
|
||||
id={cl("indicator-items")}
|
||||
onMouseEnter={onMouseEnter}
|
||||
onMouseLeave={onMouseLeave}>
|
||||
{!!(mode & IndicatorType.FRIEND) && <FriendsIndicator />}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue