From 8c22079e667d6388afbc29311b6fd9a0e9581647 Mon Sep 17 00:00:00 2001
From: Dani Palou
Date: Wed, 23 Nov 2022 11:00:18 +0100
Subject: [PATCH] MOBILE-4081 notifications: Display time when clicking push
---
src/addons/notifications/pages/notification/notification.html | 2 +-
src/addons/notifications/pages/notification/notification.ts | 1 +
src/addons/notifications/services/handlers/push-click.ts | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/addons/notifications/pages/notification/notification.html b/src/addons/notifications/pages/notification/notification.html
index 2814eeaa8..6c7f95dd6 100644
--- a/src/addons/notifications/pages/notification/notification.html
+++ b/src/addons/notifications/pages/notification/notification.html
@@ -36,7 +36,7 @@
- {{ timecreated | coreTimeAgo }} 0"> · {{
+ 0">{{ timecreated | coreTimeAgo }} 0"> · {{
userFromFullName }}
diff --git a/src/addons/notifications/pages/notification/notification.ts b/src/addons/notifications/pages/notification/notification.ts
index a53e5fa26..153c7f9c7 100644
--- a/src/addons/notifications/pages/notification/notification.ts
+++ b/src/addons/notifications/pages/notification/notification.ts
@@ -91,6 +91,7 @@ export class AddonNotificationsNotificationPage implements OnInit, OnDestroy {
this.userIdFrom = notification.userfromid ? Number(notification.userfromid) : -1;
this.profileImageUrlFrom = notification.senderImage;
this.userFromFullName = notification.userfromfullname;
+ this.timecreated = Number(notification.date ?? 0);
}
await this.loadActions(notification);
diff --git a/src/addons/notifications/services/handlers/push-click.ts b/src/addons/notifications/services/handlers/push-click.ts
index 3fc1c4d0d..ed65175a0 100644
--- a/src/addons/notifications/services/handlers/push-click.ts
+++ b/src/addons/notifications/services/handlers/push-click.ts
@@ -141,4 +141,5 @@ export type AddonNotificationsNotificationData = CorePushNotificationsNotificati
contexturl?: string; // URL related to the notification.
savedmessageid?: number; // Notification ID (optional).
id?: number; // Notification ID (optional).
+ date?: string; // Notification date (timestamp). E.g. "1669204700".
};