Skip to content

Commit 1c28d52

Browse files
committed
fix(badge): check if user is authenticated before sending update
1 parent 67b4361 commit 1c28d52

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@dvcol/base-http-client": "^1.12.2",
5555
"@dvcol/common-utils": "^1.11.1",
5656
"@dvcol/tmdb-http-client": "^1.3.3",
57-
"@dvcol/trakt-http-client": "^1.4.6",
57+
"@dvcol/trakt-http-client": "^1.4.7",
5858
"@dvcol/web-extension-utils": "^3.3.2",
5959
"@vue/devtools": "^7.0.15",
6060
"iso-3166-2": "^1.0.0",

pnpm-lock.yaml

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/stores/settings/badge.store.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ export const useBadgeStore = defineStore(BadgeStoreConstants.Store, () => {
146146
if (restored?.badgeMode !== undefined) badgeMode.value = restored.badgeMode;
147147
};
148148

149+
const { isAuthenticated } = useAuthSettingsStoreRefs();
149150
const sendBadgeUpdate = async () => {
150151
if (!enableBadge.value) return cleanCalendarBadge();
152+
if (!isAuthenticated.value) return cleanCalendarBadge();
151153
if (loading.value) {
152154
Logger.warn('Already loading badge data');
153155
return;
@@ -174,7 +176,6 @@ export const useBadgeStore = defineStore(BadgeStoreConstants.Store, () => {
174176

175177
const { isProgressEnabled } = useExtensionSettingsStoreRefs();
176178
const { user } = useUserSettingsStoreRefs();
177-
const { isAuthenticated } = useAuthSettingsStoreRefs();
178179
const initBadgeStore = async () => {
179180
await restoreState();
180181

@@ -193,7 +194,6 @@ export const useBadgeStore = defineStore(BadgeStoreConstants.Store, () => {
193194
});
194195

195196
watch(user, async () => {
196-
if (!isAuthenticated.value) return cleanCalendarBadge();
197197
await sendBadgeUpdate();
198198
});
199199

0 commit comments

Comments
 (0)