File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function handleBack() {
35
35
v-if =" accessToken != null"
36
36
@click =" store.fetchNotifications(true)"
37
37
>
38
- <Icons .Sync16 />
38
+ <Icons .Sync16 :class = " { 'sync-icon-spin': store.loadingNotifications } " />
39
39
</SidebarButton >
40
40
41
41
<SidebarButton @click =" store.setPage(Page.Settings)" >
@@ -46,6 +46,14 @@ function handleBack() {
46
46
</template >
47
47
48
48
<style lang="scss" scoped>
49
+ @keyframes spin {
50
+ 0% {
51
+ transform : rotate (0deg );
52
+ }
53
+ 100% {
54
+ transform : rotate (360deg );
55
+ }
56
+ }
49
57
.nav {
50
58
height : 100% ;
51
59
flex-shrink : 0 ;
@@ -55,6 +63,10 @@ function handleBack() {
55
63
padding : 10px ;
56
64
background-color : var (--sidebar-bg );
57
65
66
+ .sync-icon-spin {
67
+ animation : 1s spin linear infinite ;
68
+ }
69
+
58
70
.upper ,
59
71
.lower {
60
72
display : flex ;
@@ -70,6 +82,5 @@ function handleBack() {
70
82
.lower {
71
83
margin-top : auto ;
72
84
}
73
-
74
85
}
75
86
</style >
Original file line number Diff line number Diff line change
1
+ <template />
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ export const useStore = defineStore('store', () => {
23
23
if ( withSkeletons )
24
24
skeletonVisible . value = true
25
25
26
+ loadingNotifications . value = true
27
+
26
28
try {
27
29
const { data } = await getNotifications ( {
28
30
accessToken,
@@ -31,12 +33,15 @@ export const useStore = defineStore('store', () => {
31
33
} )
32
34
33
35
notifications . value = notificationListFromThreads ( data )
34
- skeletonVisible . value = false
35
36
}
36
37
catch ( error ) {
37
38
console . error ( 'NotificationError: ' , error )
38
39
notifications . value = [ ]
39
40
}
41
+ finally {
42
+ loadingNotifications . value = false
43
+ skeletonVisible . value = false
44
+ }
40
45
}
41
46
42
47
const currentPage = ref ( Page . Landing )
You can’t perform that action at this time.
0 commit comments