fix(challenge flow): abandon publish immediately on modal close

This commit is contained in:
plebeius
2026-03-05 20:47:49 +08:00
parent 59851a4b01
commit 9cc6876887
3 changed files with 11 additions and 10 deletions
+1 -2
View File
@@ -26,12 +26,11 @@ const useChallengesStore = create<State>((set, get) => ({
},
abandonCurrentChallenge: async () => {
const currentChallenge = get().challenges[0];
get().removeChallenge();
try {
await currentChallenge?.onAbandon?.();
} catch (error) {
console.error('Failed to abandon challenge publication:', error);
} finally {
get().removeChallenge();
}
},
}));