diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-07 20:08:42 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-07 20:08:42 +0900 |
| commit | b6a330928db0cf62ac0cfe484cd5e148edb9ce12 (patch) | |
| tree | bc19cb560b035b23301c7eab06e520ebdc57fc84 /src | |
| parent | Resolve #2843 (diff) | |
| download | sharkey-b6a330928db0cf62ac0cfe484cd5e148edb9ce12.tar.gz sharkey-b6a330928db0cf62ac0cfe484cd5e148edb9ce12.tar.bz2 sharkey-b6a330928db0cf62ac0cfe484cd5e148edb9ce12.zip | |
投稿の削除イベントを受け取るように
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/common/scripts/note-subscriber.ts | 11 | ||||
| -rw-r--r-- | src/client/app/desktop/views/components/notes.note.vue | 2 | ||||
| -rw-r--r-- | src/client/app/mobile/views/components/note.vue | 2 | ||||
| -rw-r--r-- | src/services/note/delete.ts | 8 |
4 files changed, 19 insertions, 4 deletions
diff --git a/src/client/app/common/scripts/note-subscriber.ts b/src/client/app/common/scripts/note-subscriber.ts index 5fc82942d5..c41897e70f 100644 --- a/src/client/app/common/scripts/note-subscriber.ts +++ b/src/client/app/common/scripts/note-subscriber.ts @@ -97,6 +97,17 @@ export default prop => ({ this.$_ns_target.poll.choices.find(c => c.id === choice).votes++; break; } + + case 'deleted': { + Vue.set(this.$_ns_target, 'deletedAt', body.deletedAt); + this.$_ns_target.text = null; + this.$_ns_target.tags = []; + this.$_ns_target.fileIds = []; + this.$_ns_target.poll = null; + this.$_ns_target.geo = null; + this.$_ns_target.cw = null; + break; + } } this.$emit(`update:${prop}`, this.$_ns_note_); diff --git a/src/client/app/desktop/views/components/notes.note.vue b/src/client/app/desktop/views/components/notes.note.vue index 3892260181..2db1479823 100644 --- a/src/client/app/desktop/views/components/notes.note.vue +++ b/src/client/app/desktop/views/components/notes.note.vue @@ -38,7 +38,7 @@ <mk-url-preview v-for="url in urls" :url="url" :key="url"/> </div> </div> - <footer> + <footer v-if="p.deletedAt == null"> <mk-reactions-viewer :note="p" ref="reactionsViewer"/> <button class="replyButton" @click="reply()" title="%i18n:@reply%"> <template v-if="p.reply">%fa:reply-all%</template> diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue index db1be4a00e..f370fbf874 100644 --- a/src/client/app/mobile/views/components/note.vue +++ b/src/client/app/mobile/views/components/note.vue @@ -39,7 +39,7 @@ </div> <span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span> </div> - <footer> + <footer v-if="p.deletedAt == null"> <mk-reactions-viewer :note="p" ref="reactionsViewer"/> <button @click="reply"> <template v-if="p.reply">%fa:reply-all%</template> diff --git a/src/services/note/delete.ts b/src/services/note/delete.ts index b5cf42ec28..2b99b4b85e 100644 --- a/src/services/note/delete.ts +++ b/src/services/note/delete.ts @@ -15,12 +15,14 @@ import config from '../../config'; * @param note 投稿 */ export default async function(user: IUser, note: INote) { + const deletedAt = new Date(); + await Note.update({ _id: note._id, userId: user._id }, { $set: { - deletedAt: new Date(), + deletedAt: deletedAt, text: null, tags: [], fileIds: [], @@ -30,7 +32,9 @@ export default async function(user: IUser, note: INote) { } }); - publishNoteStream(note._id, 'deleted', {}); + publishNoteStream(note._id, 'deleted', { + deletedAt: deletedAt + }); //#region ローカルの投稿なら削除アクティビティを配送 if (isLocalUser(user)) { |