mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Prevent spinner when failed to mount (#112)
This commit is contained in:
13
src/App.vue
13
src/App.vue
@@ -33,16 +33,25 @@ const updateNodeSearchSetting = (e: LiteGraphNodeSearchSettingEvent) => {
|
||||
nodeSearchEnabled.value = !e.detail;
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
const init = async () => {
|
||||
const nodeDefs = Object.values(await api.getNodeDefs());
|
||||
nodeSearchService.value = new NodeSearchService(nodeDefs);
|
||||
isLoading.value = false;
|
||||
|
||||
document.addEventListener("comfy:setting:color-palette-loaded", updateTheme);
|
||||
document.addEventListener(
|
||||
"comfy:setting:litegraph-node-search",
|
||||
updateNodeSearchSetting
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await init();
|
||||
} catch (e) {
|
||||
console.error("Failed to init Vue app", e);
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user