Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/notifications-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/notifications-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Components/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
</div>

<a v-if="useLink" :href="link" class="notification-subject full-subject-link">
<span v-if="icon" class="image"><img :src="icon" class="notification-icon"></span>
<span v-if="icon" class="image"><img :src="icon" class="notification-icon" alt=""></span>
<RichText v-if="subjectRich"
:text="subjectRich"
:arguments="preparedSubjectParameters" />
<span v-else class="subject">{{ subject }}</span>
</a>
<div v-else class="notification-subject">
<span v-if="icon" class="image"><img :src="icon" class="notification-icon"></span>
<span v-if="icon" class="image"><img :src="icon" class="notification-icon" alt=""></span>
<RichText v-if="subjectRich"
:text="subjectRich"
:arguments="preparedSubjectParameters" />
Expand Down
5 changes: 1 addition & 4 deletions src/NotificationsApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@
name="list"
tag="ul">
<Notification v-for="(n, index) in notifications"
:key="n.notification_id"
:key="n.notificationId"
v-bind="n"
:index="index"
:notification-id="n.notification_id"
:object-id="n.object_id"
:object-type="n.object_type"
@remove="onRemove" />
</transition-group>

Expand Down
14 changes: 13 additions & 1 deletion src/services/notificationsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ const getNotificationsData = async (tabId, lastETag, forceRefresh, hasNotifyPush
}
}

const remapAttributes = (notification) => {
notification.notificationId = notification.notification_id
notification.objectId = notification.object_id
notification.objectType = notification.object_type

delete notification.notification_id
delete notification.object_id
delete notification.object_type

return notification
}

const refreshData = async (lastETag) => {
let requestConfig = {}
if (lastETag) {
Expand All @@ -68,7 +80,7 @@ const refreshData = async (lastETag) => {
BrowserStorage.setItem('status', '' + response.status)
if (response.status !== 204) {
BrowserStorage.setItem('headers', JSON.stringify(response.headers))
BrowserStorage.setItem('data', JSON.stringify(response.data.ocs.data))
BrowserStorage.setItem('data', JSON.stringify(response.data.ocs.data.map(remapAttributes)))
}
} catch (error) {
if (error?.response?.status) {
Expand Down