Collection of handy online tools for developers, with great UX.
TypeScript converterdeveloper-productivitydeveloper-toolsfrontendjavascriptproductivitytooltoolstypescriptvuejswebsite
fix(FavoriteButton): pass tool path to favorite button (#1368)
gitmotionae1363937bf3
diff --git a/src/layouts/tool.layout.vue b/src/layouts/tool.layout.vueindex aa808f1c..ad34c4a0 100644--- a/src/layouts/tool.layout.vue+++ b/src/layouts/tool.layout.vue@@ -40,7 +40,7 @@ const toolDescription = computed<string>(() => t(`tools.${i18nKey.value}.descrip</n-h1><div>- <FavoriteButton :tool="{ name: route.meta.name } as Tool" />+ <FavoriteButton :tool="{ name: route.meta.name, path: route.path } as Tool" /></div></div>diff --git a/src/tools/tools.store.ts b/src/tools/tools.store.tsindex 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<Tool> }) {- favoriteToolsName.value.push(get(tool).path);+ const toolPath = get(tool).path;+ if (toolPath) {+ favoriteToolsName.value.push(toolPath);+ }},removeToolFromFavorites({ tool }: { tool: MaybeRef<Tool> }) {