Skip to content

Commit 6152459

Browse files
committed
fix(badge): do not fetch when not authenticated
1 parent 1f86a90 commit 6152459

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/stores/settings/badge.store.ts

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { Logger } from '~/services/logger.service';
1111
import { NotificationService } from '~/services/notification.service';
1212
import { fetchCalendarData } from '~/stores/data/calendar.store';
1313
import { fetchProgressData } from '~/stores/data/progress.store';
14+
import { useAuthSettingsStoreRefs } from '~/stores/settings/auth.store';
1415
import { useExtensionSettingsStoreRefs } from '~/stores/settings/extension.store';
1516
import { useUserSettingsStoreRefs } from '~/stores/settings/user.store';
1617
import { Colors } from '~/styles/colors.style';
@@ -173,6 +174,7 @@ export const useBadgeStore = defineStore(BadgeStoreConstants.Store, () => {
173174

174175
const { isProgressEnabled } = useExtensionSettingsStoreRefs();
175176
const { user } = useUserSettingsStoreRefs();
177+
const { isAuthenticated } = useAuthSettingsStoreRefs();
176178
const initBadgeStore = async () => {
177179
await restoreState();
178180

@@ -191,6 +193,7 @@ export const useBadgeStore = defineStore(BadgeStoreConstants.Store, () => {
191193
});
192194

193195
watch(user, async () => {
196+
if (!isAuthenticated.value) return cleanCalendarBadge();
194197
await sendBadgeUpdate();
195198
});
196199

0 commit comments

Comments
 (0)