Add list title editing (#9748)
* Add list title editing Port changes made by ash for glitch-soc * Code style fixes
This commit is contained in:
parent
dad339da6d
commit
188f1c7c89
4 changed files with 83 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue