File tree Expand file tree Collapse file tree 6 files changed +23
-8
lines changed Expand file tree Collapse file tree 6 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 13
13
"dependencies" : {
14
14
"@tauri-apps/api" : " ^1.2.0" ,
15
15
"@vueuse/core" : " ^9.12.0" ,
16
+ "dayjs" : " ^1.11.7" ,
16
17
"pinia" : " ^2.0.29" ,
17
18
"redaxios" : " ^0.5.1" ,
18
19
"tauri-plugin-autostart-api" : " github:tauri-apps/tauri-plugin-autostart" ,
Original file line number Diff line number Diff line change 1
1
<script lang="ts" setup>
2
+ import dayjs from ' dayjs'
2
3
import type { Thread } from ' ../api/notifications'
3
4
import type { NotificationListData } from ' ../types'
4
5
import { formatReason , notificationSubjectIcon } from ' ../utils/notification'
@@ -65,6 +66,8 @@ function handleRepoClick() {
65
66
66
67
<div class =" notification-item-content-subtitle" >
67
68
{{ formatReason(item.reason) }}
69
+ -
70
+ {{ dayjs(item.updatedAt).fromNow() }}
68
71
</div >
69
72
</div >
70
73
</button >
@@ -130,9 +133,9 @@ function handleRepoClick() {
130
133
@include focus-visible ;
131
134
@include text-outline ($size : 1px );
132
135
133
- & -read {
134
- color : var (--white-faded ) !important ;
135
- }
136
+ // &-read {
137
+ // color: var(--white-faded) !important;
138
+ // }
136
139
137
140
& :hover {
138
141
background-color : var (--item-hover-bg )
Original file line number Diff line number Diff line change @@ -4,21 +4,24 @@ import 'focus-visible'
4
4
import { createApp } from 'vue'
5
5
import { createPinia } from 'pinia'
6
6
import { isEnabled as isAutostartEnabled } from 'tauri-plugin-autostart-api'
7
+ import dayjs from 'dayjs'
8
+ import relativeTime from 'dayjs/plugin/relativeTime'
7
9
import App from './App.vue'
8
10
import { AppStorage , cacheStorageFromDisk } from './storage'
9
11
import { useStore } from './stores/store'
10
12
import { Page } from './constants'
11
13
import { initDevtools } from './utils/initDevtools'
12
14
import { useKey } from './composables/useKey'
13
15
14
- window . addEventListener ( 'contextmenu' , e => e . preventDefault ( ) )
16
+ ( async ( ) => {
17
+ dayjs . extend ( relativeTime )
18
+ window . addEventListener ( 'contextmenu' , e => e . preventDefault ( ) )
15
19
16
- const app = createApp ( App )
17
- const pinia = createPinia ( )
20
+ const app = createApp ( App )
21
+ const pinia = createPinia ( )
18
22
19
- app . use ( pinia )
23
+ app . use ( pinia )
20
24
21
- ; ( async ( ) => {
22
25
await cacheStorageFromDisk ( )
23
26
24
27
const store = useStore ( pinia )
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export interface NotificationListDataItem {
17
17
title : Thread [ 'subject' ] [ 'title' ]
18
18
reason : Thread [ 'reason' ]
19
19
type : Thread [ 'subject' ] [ 'type' ]
20
+ updatedAt : Thread [ 'updated_at' ]
20
21
raw : Raw < Thread >
21
22
}
22
23
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ function notificationListItemFromThread(thread: Thread): NotificationListDataIte
20
20
title : thread . subject . title ,
21
21
type : thread . subject . type ,
22
22
unread : thread . unread ,
23
+ updatedAt : thread . updated_at ,
23
24
raw : markRaw ( thread ) ,
24
25
}
25
26
}
You can’t perform that action at this time.
0 commit comments