about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/actions/importer/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/javascript/flavours/glitch/actions/importer/index.js')
-rw-r--r--app/javascript/flavours/glitch/actions/importer/index.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/actions/importer/index.js b/app/javascript/flavours/glitch/actions/importer/index.js
index f4372fb31..a7a5c60d7 100644
--- a/app/javascript/flavours/glitch/actions/importer/index.js
+++ b/app/javascript/flavours/glitch/actions/importer/index.js
@@ -9,6 +9,9 @@ export const POLLS_IMPORT    = 'POLLS_IMPORT';
 function pushUnique(array, object) {
   if (array.every(element => element.id !== object.id)) {
     array.push(object);
+  } else {
+    const idx = array.findIndex(element => element.id === object.id);
+    array.splice(idx, 1, object);
   }
 }