Skip to content

Commit 4a6e9f5

Browse files
committed
fix archived state
Signed-off-by: dartcafe <github@dartcafe.de>
1 parent bc6bff0 commit 4a6e9f5

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/stores/poll.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,10 @@ export const usePollStore = defineStore('poll', {
572572
const pollsStore = usePollsStore()
573573

574574
try {
575-
await PollsAPI.toggleArchive(payload.pollId)
575+
const response = await PollsAPI.toggleArchive(payload.pollId)
576+
if (this.id === payload.pollId) {
577+
this.$patch(response.data.poll)
578+
}
576579
} catch (error) {
577580
if ((error as AxiosError)?.code === 'ERR_CANCELED') {
578581
return

0 commit comments

Comments
 (0)