Questify: Fix Achievement Quest Auto-Deauth. (#1341)
* Fix Achievement Quest Auto-Deauth. * Fix Patch. * Format Orbs Popout. * Cursed Orbs Wrap.
This commit is contained in:
parent
73abc69962
commit
829b9b42c6
2 changed files with 23 additions and 3 deletions
|
|
@ -96,6 +96,10 @@ function enrolledIncompleteButton(args: { quest: Quest, size: string; }): JSX.El
|
|||
);
|
||||
}
|
||||
|
||||
function wrapOrbsBalance(balance: String): JSX.Element {
|
||||
return (<span style={{ fontSize: "90%" }}>{balance}</span>);
|
||||
}
|
||||
|
||||
export default definePlugin({
|
||||
name: "Questify",
|
||||
description: "Enhance specific Quest features, disable annoyances, or completely remove Quests.",
|
||||
|
|
@ -137,6 +141,7 @@ export default definePlugin({
|
|||
sortQuests,
|
||||
stopQuestAutoComplete,
|
||||
useQuestRerender,
|
||||
wrapOrbsBalance,
|
||||
|
||||
patches: [
|
||||
{
|
||||
|
|
@ -224,7 +229,7 @@ export default definePlugin({
|
|||
predicate: () => !getQuestifySettings().disableQuestsEverything && getQuestifySettings().disableOrbsAndQuestsBadges,
|
||||
replacement: [
|
||||
{
|
||||
match: /(,\{badges:\i)(?=,displayProfile:\i)/,
|
||||
match: /(,{badges:\i)(?=,overflowCount:\i,displayProfile:\i)/,
|
||||
replace: '$1.filter(badge=>!["quest_completed","orb_profile_badge"].includes(badge.id))',
|
||||
}
|
||||
]
|
||||
|
|
@ -275,7 +280,7 @@ export default definePlugin({
|
|||
}
|
||||
},
|
||||
{
|
||||
// Formats the Orbs balance on the Quests page with locale string formatting.
|
||||
// Formats the Orbs balance in the default balance counter on the Quests page with locale string formatting.
|
||||
find: '("BalanceCounter")',
|
||||
predicate: () => !getQuestifySettings().disableQuestsEverything,
|
||||
replacement: [
|
||||
|
|
@ -284,11 +289,22 @@ export default definePlugin({
|
|||
replace: "$1+($2>=1e6?0.8:$2>=1e3?0.4:0)"
|
||||
},
|
||||
{
|
||||
match: /(?<=children:\i.to\(\i=>`\${\i).toFixed\(0\)/,
|
||||
match: /(?<=children:\i.to\(\i=>`\${\i)(.toFixed\(0\))/,
|
||||
replace: ".toLocaleString(undefined,{maximumFractionDigits:0})"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// Formats the Orbs balance in the balance popout on the Quests page with locale string formatting.
|
||||
find: "PremiumTenureRewardsOrbsBalancePopover",
|
||||
predicate: () => !getQuestifySettings().disableQuestsEverything,
|
||||
replacement: [
|
||||
{
|
||||
match: /(?<=children:)(\i\?\?0)/,
|
||||
replace: "$self.wrapOrbsBalance(($1).toLocaleString(undefined,{maximumFractionDigits:0}))"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
// Removes stack traces from Quest auto-complete network actions and marks both patches as healthy.
|
||||
find: "NetworkActionNames.QUEST_VIDEO_PROGRESS,",
|
||||
|
|
|
|||
|
|
@ -1091,6 +1091,7 @@ async function runAchievementQuest(quest: Quest, entry: AutoCompleteEntry, targe
|
|||
}
|
||||
|
||||
const result = await QuestifyNative.complete(appId, authCode, target.adjusted, quest.id, await getActivityReferrer(appId));
|
||||
await RestAPI.get({ url: "/oauth2/tokens" });
|
||||
const success = result.success === true;
|
||||
|
||||
setQuestAutoCompleteProgress(quest, success ? target.adjusted : 0);
|
||||
|
|
@ -1100,6 +1101,9 @@ async function runAchievementQuest(quest: Quest, entry: AutoCompleteEntry, targe
|
|||
|
||||
if (deauthToken) {
|
||||
await RestAPI.del({ url: `/oauth2/tokens/${deauthToken}` });
|
||||
QL.info("AUTO_COMPLETE_ACHIEVEMENT_DEAUTH_SUCCESS", { questId: quest.id, questName: entry.questName, appId });
|
||||
} else {
|
||||
QL.error("AUTO_COMPLETE_ACHIEVEMENT_DEAUTH_FAILED", { questId: quest.id, questName: entry.questName, error: "DEAUTH Token Not Found." });
|
||||
}
|
||||
} catch (error) {
|
||||
QL.error("AUTO_COMPLETE_ACHIEVEMENT_DEAUTH_FAILED", { questId: quest.id, questName: entry.questName, error });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue