fix(frontend): handle errors and loading state in dish view
Catch and display errors during dish and editor options loading Ensure loading state is reset in finally block
This commit is contained in:
@@ -305,7 +305,13 @@ async function loadPage() {
|
|||||||
} catch {
|
} catch {
|
||||||
currentUser.value = null;
|
currentUser.value = null;
|
||||||
}
|
}
|
||||||
await Promise.all([initialCategoriesLoaded.value ? Promise.resolve() : loadDish(), loadEditorOptions()]);
|
try {
|
||||||
|
await Promise.all([initialCategoriesLoaded.value ? Promise.resolve() : loadDish(), loadEditorOptions()]);
|
||||||
|
} catch (error) {
|
||||||
|
message.value = errorText(error);
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(categories, (nextCategories) => {
|
watch(categories, (nextCategories) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user