From c3867b883569bdc28250befe7482daace57ae869 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sat, 3 Aug 2024 17:50:27 +0200 Subject: [PATCH] fix error handling: not inifinite loading wehn error occurs while updating profile --- src/Components/Profile/itemFunctions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Components/Profile/itemFunctions.ts b/src/Components/Profile/itemFunctions.ts index f91ad5d8..7f170916 100644 --- a/src/Components/Profile/itemFunctions.ts +++ b/src/Components/Profile/itemFunctions.ts @@ -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);