Questify: Add Copy Quest ID button and add missing cleanup. (#607)
This commit is contained in:
parent
0e4d11acdb
commit
da5030c173
1 changed files with 7 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ import { addServerListElement, removeServerListElement, ServerListRenderPosition
|
|||
import { migratePluginToSettings } from "@api/Settings";
|
||||
import { ErrorBoundary, openPluginModal } from "@components/index";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import { copyToClipboard } from "@utils/index";
|
||||
import definePlugin, { PluginNative, StartAt } from "@utils/types";
|
||||
import { onceReady } from "@webpack";
|
||||
import { ContextMenuApi, Menu, NavigationRouter, RestAPI, useEffect, useState } from "@webpack/common";
|
||||
|
|
@ -283,6 +284,11 @@ function QuestTileContextMenu(children: React.ReactNode[], props: { quest: any;
|
|||
}}
|
||||
/>
|
||||
}
|
||||
<Menu.MenuItem
|
||||
id={q("copy-quest-id")}
|
||||
label="Copy Quest ID"
|
||||
action={() => { copyToClipboard(props.quest.id); }}
|
||||
/>
|
||||
</Menu.MenuGroup>
|
||||
));
|
||||
}
|
||||
|
|
@ -848,11 +854,11 @@ async function startAchievementActivityProgressTracking(quest: Quest, questTarge
|
|||
}
|
||||
|
||||
const result = await QuestifyNative.complete(appID, authCode!, questTarget);
|
||||
activeQuestIntervals.delete(quest.id);
|
||||
|
||||
if (!result.success) {
|
||||
const errorReason = result.error || "An error occurred while completing the Quest.";
|
||||
QuestifyLogger.error(`[${getFormattedNow()}] Failed to complete Quest ${questName}:`, errorReason);
|
||||
activeQuestIntervals.delete(quest.id);
|
||||
return;
|
||||
} else {
|
||||
QuestifyLogger.info(`[${getFormattedNow()}] Quest ${questName} completed.`);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue