fix error handling: not inifinite loading wehn error occurs while updating profile

This commit is contained in:
Anton Tranelis 2024-08-03 17:50:27 +02:00
parent ce3959d248
commit c3867b8835

View File

@ -178,6 +178,7 @@ export const onUpdateItem = async (state, item, tags, addTag, setLoading, naviga
},
},
})
.catch(setLoading(false))
.then(() => item && updateItem({ ...item, ...changedItem }))
.then(() => {
setLoading(false);
@ -198,6 +199,7 @@ export const onUpdateItem = async (state, item, tags, addTag, setLoading, naviga
},
},
})
.catch(setLoading(false))
.then(() => item && addItem({ ...item, ...changedItem, layer: item.layer, user_created: user, type: item.layer?.itemType }))
.then(() => {
setLoading(false);