From d87539e89746885101ed26c7c08ed8975ce03120 Mon Sep 17 00:00:00 2001 From: xiaomai Date: Thu, 7 May 2026 09:45:30 +0800 Subject: [PATCH] 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 --- frontend/src/views/DishView.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/DishView.vue b/frontend/src/views/DishView.vue index 37b36c8..2597e7e 100644 --- a/frontend/src/views/DishView.vue +++ b/frontend/src/views/DishView.vue @@ -305,7 +305,13 @@ async function loadPage() { } catch { 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) => {