Procházet zdrojové kódy

Replace post content of deleted posts with deleted message

sbkwgh před 8 roky
rodič
revize
12210ad4be
1 změnil soubory, kde provedl 9 přidání a 0 odebrání
  1. 9 0
      src/store/modules/thread.js

+ 9 - 0
src/store/modules/thread.js

@@ -44,6 +44,15 @@ const actions = {
 			.then(res => {
 				commit('setRemovePostsButtonLoading', false)
 				commit('setShowRemovePostsButton', false)
+
+				state.posts = state.posts.map(post => {
+					if(state.selectedPosts.includes(post.id)) {
+						post.content = '<p>[This post has been removed by an administrator]</p>'
+					}
+
+					return post
+				})
+				state.selectedPosts = []
 			})
 			.catch(e => {
 				commit('setRemovePostsButtonLoading', false)