feat(FavoriteButton) fix favorite button funtionality on tool page
This commit is contained in:
		
							parent
							
								
									c7b80fbc78
								
							
						
					
					
						commit
						f6589c27f9
					
				| @ -40,7 +40,7 @@ const toolDescription = computed<string>(() => t(`tools.${i18nKey.value}.descrip | |||||||
|           </n-h1> |           </n-h1> | ||||||
| 
 | 
 | ||||||
|           <div> |           <div> | ||||||
|             <FavoriteButton :tool="{ name: route.meta.name } as Tool" /> |             <FavoriteButton :tool="{ name: route.meta.name, path: route.path } as Tool" /> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -45,7 +45,10 @@ export const useToolStore = defineStore('tools', () => { | |||||||
|     newTools: computed(() => tools.value.filter(({ isNew }) => isNew)), |     newTools: computed(() => tools.value.filter(({ isNew }) => isNew)), | ||||||
| 
 | 
 | ||||||
|     addToolToFavorites({ tool }: { tool: MaybeRef<Tool> }) { |     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> }) { |     removeToolFromFavorites({ tool }: { tool: MaybeRef<Tool> }) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user