소스 검색

fix(notification): improve notification display and sorting

Jacky 2 달 전
부모
커밋
3e2a95269e
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      app/src/components/Notification/Notification.vue

+ 3 - 2
app/src/components/Notification/Notification.vue

@@ -69,7 +69,7 @@ function newSSE() {
 
 function init() {
   loading.value = true
-  notificationApi.get_list().then(r => {
+  notificationApi.get_list({ sort: 'desc', order_by: 'created_at' }).then(r => {
     data.value = r.data
     unreadCount.value = r.pagination?.total || 0
   }).finally(() => {
@@ -182,7 +182,8 @@ function viewAll() {
                 <template #description>
                   <div class="flex justify-between items-center">
                     <div>
-                      {{ notifications[item.title].content(item.details) }}
+                      {{ notifications[item.title]?.content(item.details)
+                        || item.content || item.details }}
                     </div>
                     <span
                       key="list-loadmore-remove"