11<!--
2- - @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
3- -
4- - @author John Molakvoæ <skjnldsv@protonmail.com>
5- -
6- - @license GNU AGPL version 3 or any later version
7- -
8- - This program is free software: you can redistribute it and/or modify
9- - it under the terms of the GNU Affero General Public License as
10- - published by the Free Software Foundation, either version 3 of the
11- - License, or (at your option) any later version.
12- -
13- - This program is distributed in the hope that it will be useful,
14- - but WITHOUT ANY WARRANTY; without even the implied warranty of
15- - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16- - GNU Affero General Public License for more details.
17- -
18- - You should have received a copy of the GNU Affero General Public License
19- - along with this program. If not, see <http://www.gnu.org/licenses/>.
20- -
21- -->
2+ - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
3+ - SPDX-License-Identifier: AGPL-3.0-or-later
4+ -->
225<template >
236 <component :is =" tag"
24- v-show =" !deleted"
7+ v-show =" !deleted && !isLimbo "
258 :class =" {'comment--loading': loading}"
269 class =" comment" >
2710 <!-- Comment header toolbar -->
6952 <div v-if =" id && loading" class =" comment_loading icon-loading-small" />
7053
7154 <!-- Relative time to the comment creation -->
72- <Moment v-else-if =" creationDateTime" class =" comment__timestamp" :timestamp =" timestamp" />
55+ <NcDateTime v-else-if =" creationDateTime"
56+ class =" comment__timestamp"
57+ :timestamp =" timestamp"
58+ :ignore-seconds =" true" />
7359 </div >
7460
7561 <!-- Message editor -->
119105<script >
120106import { getCurrentUser } from ' @nextcloud/auth'
121107import { translate as t } from ' @nextcloud/l10n'
122- import moment from ' @nextcloud/moment'
123108
124109import NcActionButton from ' @nextcloud/vue/dist/Components/NcActionButton.js'
125110import NcActions from ' @nextcloud/vue/dist/Components/NcActions.js'
126111import NcActionSeparator from ' @nextcloud/vue/dist/Components/NcActionSeparator.js'
127112import NcAvatar from ' @nextcloud/vue/dist/Components/NcAvatar.js'
128113import NcButton from ' @nextcloud/vue/dist/Components/NcButton.js'
114+ import NcDateTime from ' @nextcloud/vue/dist/Components/NcDateTime.js'
115+ import NcLoadingIcon from ' @nextcloud/vue/dist/Components/NcLoadingIcon.js'
129116import RichEditorMixin from ' @nextcloud/vue/dist/Mixins/richEditor.js'
130117
131118import IconArrowRight from ' vue-material-design-icons/ArrowRight.vue'
132119import IconClose from ' vue-material-design-icons/Close.vue'
133120import IconDelete from ' vue-material-design-icons/Delete.vue'
134121import IconEdit from ' vue-material-design-icons/Pencil.vue'
135122
136- import Moment from ' ./Moment.vue'
137123import CommentMixin from ' ../mixins/CommentMixin.js'
124+ import { mapStores } from ' pinia'
125+ import { useDeletedCommentLimbo } from ' ../store/deletedCommentLimbo.js'
138126
139127// Dynamic loading
140128const NcRichContenteditable = () => import (' @nextcloud/vue/dist/Components/NcRichContenteditable.js' )
@@ -147,15 +135,15 @@ export default {
147135 IconClose,
148136 IconDelete,
149137 IconEdit,
150- Moment,
151138 NcActionButton,
152139 NcActions,
153140 NcActionSeparator,
154141 NcAvatar,
155142 NcButton,
143+ NcDateTime,
144+ NcLoadingIcon,
156145 NcRichContenteditable,
157146 },
158-
159147 mixins: [RichEditorMixin, CommentMixin],
160148
161149 inheritAttrs: false ,
@@ -207,6 +195,7 @@ export default {
207195 },
208196
209197 computed: {
198+ ... mapStores (useDeletedCommentLimbo),
210199
211200 /**
212201 * Is the current user the author of this comment
@@ -233,9 +222,15 @@ export default {
233222 return ! this .localMessage || this .localMessage .trim () === ' '
234223 },
235224
225+ /**
226+ * Timestamp of the creation time (in ms UNIX time)
227+ */
236228 timestamp () {
237- // seconds, not milliseconds
238- return parseInt (moment (this .creationDateTime ).format (' x' ), 10 ) / 1000
229+ return Date .parse (this .creationDateTime )
230+ },
231+
232+ isLimbo () {
233+ return this .deletedCommentLimboStore .checkForId (this .id )
239234 },
240235 },
241236
@@ -350,7 +345,7 @@ $comment-padding: 10px;
350345
351346 & __submit {
352347 position : absolute !important ;
353- bottom : 0 ;
348+ bottom : 5 px ;
354349 right : 0 ;
355350 }
356351
0 commit comments