Explorar o código

#4790 User experience: add a post to a collection just right after deleting it from there

mbliznikova hai 1 ano
pai
achega
7cb075dbf9
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      resources/assets/js/components/CollectionComponent.vue

+ 4 - 0
resources/assets/js/components/CollectionComponent.vue

@@ -619,6 +619,9 @@ export default {
 			this.posts = this.posts.filter(post => {
 			this.posts = this.posts.filter(post => {
 				return post.id != id;
 				return post.id != id;
 			});
 			});
+			this.ids = this.ids.filter(post_id => {
+				return post_id != id;
+			});
 		},
 		},
 
 
 		addRecentId(post) {
 		addRecentId(post) {
@@ -630,6 +633,7 @@ export default {
 				// window.location.reload();
 				// window.location.reload();
 				this.closeModals();
 				this.closeModals();
 				this.posts.push(res.data);
 				this.posts.push(res.data);
+				this.ids.push(post.id);
 				this.collection.post_count++;
 				this.collection.post_count++;
 			}).catch(err => {
 			}).catch(err => {
 				swal('Oops!', 'An error occured, please try selecting another post.', 'error');
 				swal('Oops!', 'An error occured, please try selecting another post.', 'error');