Skip to content

Commit ab64adc

Browse files
committed
fix(checkin): refresh progress and calendar view on checkin event
1 parent 4e69561 commit ab64adc

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/components/views/history/HistoryComponent.vue

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import { usePanelItem } from '~/components/views/panel/use-panel-item';
1313
import { useAppStateStoreRefs } from '~/stores/app-state.store';
1414
import { useHistoryStore, useHistoryStoreRefs } from '~/stores/data/history.store';
15+
import { useWatchingStoreRefs } from '~/stores/data/watching.store';
1516
import { useI18n } from '~/utils/i18n.utils';
1617
import { watchUserChange } from '~/utils/store.utils';
1718
@@ -20,6 +21,7 @@ const { footerOpen, panelOpen, panelDirty } = useAppStateStoreRefs();
2021
const { filteredHistory, pagination, loading, pageSize, belowThreshold, searchHistory } =
2122
useHistoryStoreRefs();
2223
const { fetchHistory, clearState } = useHistoryStore();
24+
const { isWatching } = useWatchingStoreRefs();
2325
2426
const i18n = useI18n('history');
2527
@@ -32,6 +34,10 @@ onMounted(() => {
3234
watch(panelOpen, async value => {
3335
if (!value && panelDirty.value) await fetchHistory();
3436
});
37+
watch(isWatching, async () => {
38+
if (panelOpen.value) return;
39+
await fetchHistory();
40+
});
3541
});
3642
3743
const list = useListScroll(filteredHistory, 'watched_at');

src/components/views/progress/ProgressComponent.vue

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { usePanelItem } from '~/components/views/panel/use-panel-item';
1111
import { ExternaLinks } from '~/settings/external.links';
1212
import { useAppStateStoreRefs } from '~/stores/app-state.store';
1313
import { useProgressStore, useProgressStoreRefs } from '~/stores/data/progress.store';
14+
import { useWatchingStoreRefs } from '~/stores/data/watching.store';
1415
import { useI18n } from '~/utils/i18n.utils';
1516
import { watchUserChange } from '~/utils/store.utils';
1617
@@ -20,6 +21,7 @@ const { footerOpen, panelOpen, panelDirty } = useAppStateStoreRefs();
2021
2122
const { progress, loading, loggedOut } = useProgressStoreRefs();
2223
const { fetchProgress, clearState } = useProgressStore();
24+
const { isWatching } = useWatchingStoreRefs();
2325
2426
watchUserChange({
2527
fetch: fetchProgress,
@@ -30,6 +32,10 @@ onMounted(() => {
3032
watch(panelOpen, async value => {
3133
if (!value && panelDirty.value) await fetchProgress();
3234
});
35+
watch(isWatching, async () => {
36+
if (panelOpen.value) return;
37+
await fetchProgress();
38+
});
3339
});
3440
3541
const { scrolled, listRef, onClick } = useBackToTop();

0 commit comments

Comments
 (0)