about summary refs log tree commit diff
path: root/app/javascript/mastodon/reducers/list_editor.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-02-15 18:02:45 +0100
committerThibaut Girka <thib@sitedethib.com>2019-02-15 18:02:45 +0100
commit06cc04fd239896d294210b8bbaadb7c611aaffe5 (patch)
tree1868711bbe9ee79b25ff10a585457cfa0f9ac121 /app/javascript/mastodon/reducers/list_editor.js
parent2769b5446681898e8332cb505f499dac2a6e5717 (diff)
parent8ef50706a11e115e8b4aa31b30de93738bc7e754 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/javascript/mastodon/reducers/list_editor.js')
-rw-r--r--app/javascript/mastodon/reducers/list_editor.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/javascript/mastodon/reducers/list_editor.js b/app/javascript/mastodon/reducers/list_editor.js
index 02a0dabb1..91e524dd5 100644
--- a/app/javascript/mastodon/reducers/list_editor.js
+++ b/app/javascript/mastodon/reducers/list_editor.js
@@ -22,6 +22,7 @@ import {
 const initialState = ImmutableMap({
   listId: null,
   isSubmitting: false,
+  isChanged: false,
   title: '',
 
   accounts: ImmutableMap({
@@ -47,10 +48,16 @@ export default function listEditorReducer(state = initialState, action) {
       map.set('isSubmitting', false);
     });
   case LIST_EDITOR_TITLE_CHANGE:
-    return state.set('title', action.value);
+    return state.withMutations(map => {
+      map.set('title', action.value);
+      map.set('isChanged', true);
+    });
   case LIST_CREATE_REQUEST:
   case LIST_UPDATE_REQUEST:
-    return state.set('isSubmitting', true);
+    return state.withMutations(map => {
+      map.set('isSubmitting', true);
+      map.set('isChanged', false);
+    });
   case LIST_CREATE_FAIL:
   case LIST_UPDATE_FAIL:
     return state.set('isSubmitting', false);