We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a92ded2 commit 67522d8Copy full SHA for 67522d8
1 file changed
src/components/entry/overview/SaveToListButton.js
@@ -234,10 +234,14 @@ const SaveToListButton = ({ containerRef }) => {
234
setNewListName('')
235
}
236
237
- const handleConfirmNewList = () => {
+ const handleConfirmNewList = async () => {
238
const trimmed = newListName.trim()
239
if (trimmed) {
240
- dispatch(addList({ name: trimmed }))
+ const resultAction = await dispatch(addList({ name: trimmed }))
241
+ if (addList.fulfilled.match(resultAction)) {
242
+ const newList = resultAction.payload
243
+ dispatch(addLocationToList({ listId: newList.id, location }))
244
+ }
245
246
setAddingNew(false)
247
0 commit comments