@@ -20,10 +20,12 @@ import MenuItems, { menuItem } from '../components/MenuItems.vue'
2020import { type UseKeyOptions , useKey } from ' ../composables/useKey'
2121import { CheckedNotificationProcess , notificationApiMutex } from ' ../constants'
2222import { everySome } from ' ../utils/array'
23+ import { useRoute } from ' ../composables/useRoute'
2324
2425const store = useStore ()
26+ const route = useRoute ()
2527
26- if (store . currentPageState .fetchOnEnter )
28+ if (route . state . value .fetchOnEnter )
2729 store .fetchNotifications (true )
2830
2931function handleOpenNotification(thread : Thread ) {
@@ -318,7 +320,6 @@ whenever(() => store.skeletonVisible, () => {
318320 :wowerlayOptions =" { position: 'right-start' }"
319321 @visibilityChange =" (visible) => {
320322 popoverVisible = visible;
321- ({}).constructor.constructor('return console.log')()({ visible })
322323
323324 if (!visible) {
324325 popoverTarget = null
@@ -328,64 +329,39 @@ whenever(() => store.skeletonVisible, () => {
328329 <MenuItems :items =" contextMenuItems" />
329330 </Popover >
330331
331- <div class =" home-wrapper" >
332- <div
333- ref =" home"
334- class =" home"
335- >
336- <NotificationSkeleton v-if =" store.skeletonVisible" />
337-
338- <EmptyState
339- v-else-if =" store.failedLoadingNotifications"
340- :iconSize =" EmptyStateIconSize.Big"
341- :icon =" Icons.X"
342- description =" Oopsie! Couldn't load notifications."
343- >
344- <template #footer >
345- <AppButton @click =" store.fetchNotifications(true)" >
346- Refresh
347- </AppButton >
348- </template >
349- </EmptyState >
350-
351- <EmptyState
352- v-else-if =" store.notifications.length === 0"
353- :iconSize =" EmptyStateIconSize.Big"
354- :icon =" Icons.Check"
355- description =" It's all clear sir!"
356- />
357-
358- <NotificationItem
359- v-for =" item of store.notifications"
360- :key =" item.id"
361- :value =" item"
362- :checked =" isChecked(item)"
363- :checkable =" isCheckable(item)"
364- :indeterminate =" isIndeterminate(item)"
365- :checkboxVisible =" store.checkedItems.length > 0"
366- @contextmenu =" handleThreadContextmenu"
367- @click:notification =" handleClickNotification"
368- @click:repo =" handleRepoClick"
369- @update:checked =" (value) => handleUpdateChecked(item, value)"
370- />
371- </div >
372- </div >
373- </template >
332+ <NotificationSkeleton v-if =" store.skeletonVisible" />
374333
375- <style lang="scss" scoped>
376- .home {
377- padding : 10px ;
378- width : 100% ;
379- height : 100% ;
380- scroll-padding-top : 10px ;
381- scroll-padding-bottom : 10px ;
382- position : relative ;
383-
384- & -wrapper {
385- display : flex ;
386- flex-flow : column nowrap ;
387- height : 100% ;
388- width : 100% ;
389- }
390- }
391- </style >
334+ <EmptyState
335+ v-else-if =" store.failedLoadingNotifications"
336+ :iconSize =" EmptyStateIconSize.Big"
337+ :icon =" Icons.X"
338+ description =" Oopsie! Couldn't load notifications."
339+ >
340+ <template #footer >
341+ <AppButton @click =" store.fetchNotifications(true)" >
342+ Refresh
343+ </AppButton >
344+ </template >
345+ </EmptyState >
346+
347+ <EmptyState
348+ v-else-if =" store.notifications.length === 0"
349+ :iconSize =" EmptyStateIconSize.Big"
350+ :icon =" Icons.Check"
351+ description =" It's all clear sir!"
352+ />
353+
354+ <NotificationItem
355+ v-for =" item of store.notifications"
356+ :key =" item.id"
357+ :value =" item"
358+ :checked =" isChecked(item)"
359+ :checkable =" isCheckable(item)"
360+ :indeterminate =" isIndeterminate(item)"
361+ :checkboxVisible =" store.checkedItems.length > 0"
362+ @contextmenu =" handleThreadContextmenu"
363+ @click:notification =" handleClickNotification"
364+ @click:repo =" handleRepoClick"
365+ @update:checked =" (value) => handleUpdateChecked(item, value)"
366+ />
367+ </template >
0 commit comments