fix: 🐛 Hämta alla aviseringar och sortera på senast ändrad

This commit is contained in:
Kajetan Kazimierczak 2021-09-30 22:27:57 +02:00
parent fab42c8d29
commit 71cb230b92
5 changed files with 18 additions and 8 deletions

View File

@ -16,7 +16,9 @@ export const Notification = ({ item }: NotificationProps) => {
const open = () => setIsOpen(true)
const close = () => setIsOpen(false)
const displayDate = item.dateCreated
const displayDate = item.dateModified
? moment(item.dateModified).fromNow()
: item.dateCreated
? moment(item.dateCreated).fromNow()
: null

View File

@ -10,6 +10,14 @@ export const NotificationsList = () => {
const child = useChild()
const { data } = useNotifications(child)
data.sort((a, b) =>
a.dateModified > b.dateModified
? -1
: b.dateModified > a.dateModified
? 1
: 0
)
return (
<List
style={styles.container}

View File

@ -606,7 +606,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
DoubleConversion: cf9b38bf0b2d048436d9a82ad2abe1404f11e7de
FBLazyVector: 33c82491102f20ecddb6c6a2c273696ace3191e0
FBReactNativeSpec: df8f81d2a7541ee6755a047b398a5cb5a72acd0e
Flipper: b1fddf9a17c32097b2b4c806ad158b2f36bb2692
@ -619,7 +619,7 @@ SPEC CHECKSUMS:
Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
FlipperKit: aec2d931adeee48a07bab1ea8bcc8a6bb87dfce4
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 5337263514dd6f09803962437687240c5dc39aa4
glog: 73c2498ac6884b13ede40eda8228cb1eee9d9d62
hermes-engine: 7dcd1dbd908e6353bd7e4a4add72dba7bf76bf84
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: 1aa4f6a6ee7256b83db99ec1ccdaa80d10f9af9b

View File

@ -28,7 +28,7 @@
"@react-navigation/stack": "5.14.4",
"@skolplattformen/api-hooks": "3.0.0",
"@skolplattformen/curriculum": "1.4.2",
"@skolplattformen/embedded-api": "5.3.2",
"@skolplattformen/embedded-api": "5.3.3",
"@ui-kitten/components": "5.0.0",
"@ui-kitten/eva-icons": "5.0.0",
"buffer": "6.0.3",

View File

@ -1341,10 +1341,10 @@
dependencies:
deepmerge "^4.2.2"
"@skolplattformen/embedded-api@5.3.2":
version "5.3.2"
resolved "https://registry.yarnpkg.com/@skolplattformen/embedded-api/-/embedded-api-5.3.2.tgz#13bf2192ecd5d7e4140c17183eab574988eb9e00"
integrity sha512-sh7NaImGDBfb5AO9igFVtTn1atWZ423yYU2HivsbcdDkFJgWXkwuTShWnV92bhV5qjUIF5ckNvdpV7FvJdp5WA==
"@skolplattformen/embedded-api@5.3.3":
version "5.3.3"
resolved "https://registry.yarnpkg.com/@skolplattformen/embedded-api/-/embedded-api-5.3.3.tgz#9c8b9c93a4d3f4857c79568a6be8b6bcab1817c2"
integrity sha512-rLE23xHdXSeBnax/pWEaVMG2nB9iHAk6tpIOnjCzcFUbm4OYNeJlfgoJkIZgNsDu5wYGJad7VJU0L0FSwVVnMA==
dependencies:
camelcase-keys "^6.2.2"
change-case "^4.1.2"