File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66<script setup lang="ts">
77import { computed } from ' vue'
8- import moment from ' @nextcloud/moment '
8+ import { DateTime } from ' luxon '
99
1010import NcUserBubble from ' @nextcloud/vue/components/NcUserBubble'
1111import NcRichText from ' @nextcloud/vue/components/NcRichText'
@@ -20,7 +20,7 @@ const props = defineProps({
2020})
2121
2222const dateActivityRelative = computed (() =>
23- moment (props .activity .datetime ).fromNow (),
23+ DateTime . fromISO (props .activity .datetime ).toRelative (),
2424)
2525
2626const message = computed (() => {
@@ -32,7 +32,9 @@ const message = computed(() => {
3232 && parameters .after .id .startsWith (' dt:' )
3333 ) {
3434 const dateTime = parameters .after .id .slice (3 )
35- parameters .after .name = moment (dateTime ).format (' L LTS' )
35+ parameters .after .name = DateTime .fromISO (dateTime ).toLocaleString (
36+ DateTime .DATETIME_SHORT ,
37+ )
3638 }
3739
3840 Object .keys (parameters ).forEach (function (key ) {
Original file line number Diff line number Diff line change 66<script setup lang="ts">
77import { computed , onMounted , onUnmounted } from ' vue'
88import { t } from ' @nextcloud/l10n'
9- import { subscribe , unsubscribe } from ' @nextcloud/event-bus'
109
1110import NcEmptyContent from ' @nextcloud/vue/components/NcEmptyContent'
1211
1312import ActivityIcon from ' vue-material-design-icons/LightningBolt.vue'
1413
1514import Activities from ' ../Activity/Activities.vue'
1615import { useActivityStore } from ' ../../stores/activity'
17- import { Event } from ' ../../Types '
16+ import { onBeforeRouteUpdate } from ' vue-router '
1817
1918const activityStore = useActivityStore ()
2019const emptyContentProps = {
@@ -26,11 +25,15 @@ const showEmptyContent = computed(
2625)
2726
2827onMounted (() => {
29- subscribe (Event .UpdateActivity , () => activityStore .load ())
28+ activityStore .load ()
29+ })
30+
31+ onBeforeRouteUpdate (async () => {
32+ activityStore .load ()
3033})
3134
3235onUnmounted (() => {
33- unsubscribe ( Event . UpdateActivity , () => activityStore .load () )
36+ activityStore .$reset ( )
3437})
3538 </script >
3639
You can’t perform that action at this time.
0 commit comments