From ae1363937bf365a0cd4ce6031971908c4b31f55f Mon Sep 17 00:00:00 2001 From: gitmotion <43588713+gitmotion@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:27:14 -0700 Subject: [PATCH] fix(FavoriteButton): pass tool path to favorite button (#1368) --- src/layouts/tool.layout.vue | 2 +- src/tools/tools.store.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/layouts/tool.layout.vue b/src/layouts/tool.layout.vue index aa808f1c..ad34c4a0 100644 --- a/src/layouts/tool.layout.vue +++ b/src/layouts/tool.layout.vue @@ -40,7 +40,7 @@ const toolDescription = computed(() => t(`tools.${i18nKey.value}.descrip
- +
diff --git a/src/tools/tools.store.ts b/src/tools/tools.store.ts index 86ef2050..631390fe 100644 --- a/src/tools/tools.store.ts +++ b/src/tools/tools.store.ts @@ -45,7 +45,10 @@ export const useToolStore = defineStore('tools', () => { newTools: computed(() => tools.value.filter(({ isNew }) => isNew)), addToolToFavorites({ tool }: { tool: MaybeRef }) { - favoriteToolsName.value.push(get(tool).path); + const toolPath = get(tool).path; + if (toolPath) { + favoriteToolsName.value.push(toolPath); + } }, removeToolFromFavorites({ tool }: { tool: MaybeRef }) {