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:
2026-05-07 09:45:30 +08:00
parent 82f08c1684
commit d87539e897

View File

@@ -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) => {