Skip to content

Commit

Permalink
Prevent spinner when failed to mount (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Jul 12, 2024
1 parent 86ee076 commit 04aad41
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit 04aad41

Please sign in to comment.