mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 10:13:32 -04:00 
			
		
		
		
	fix: show copy to clipboard failure (#2886)
* fix for AppButtonCopy * add some logging * fix if statement * refactor, use .then * check for copied * Fix recipe share link * refactor AppButtonCopy * update tooltip text * update use-copy * logging * fix is supported check * more fixes for use-copy.ts --------- Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
		| @@ -143,7 +143,7 @@ export default defineComponent({ | ||||
|     } | ||||
|  | ||||
|     const { share, isSupported: shareIsSupported } = useShare(); | ||||
|     const { copy } = useClipboard(); | ||||
|     const { copy, copied, isSupported } = useClipboard(); | ||||
|  | ||||
|     function getRecipeText() { | ||||
|       return i18n.t("recipe.share-recipe-message", [props.name]); | ||||
| @@ -154,8 +154,18 @@ export default defineComponent({ | ||||
|     } | ||||
|  | ||||
|     async function copyTokenLink(token: string) { | ||||
|       await copy(getTokenLink(token)); | ||||
|       alert.success(i18n.t("recipe-share.recipe-link-copied-message") as string); | ||||
|       if (isSupported.value) { | ||||
|         await copy(getTokenLink(token)); | ||||
|         if (copied.value) { | ||||
|           alert.success(i18n.t("recipe-share.recipe-link-copied-message") as string); | ||||
|         } | ||||
|         else { | ||||
|           alert.error(i18n.t("general.clipboard-copy-failure") as string); | ||||
|         } | ||||
|       } | ||||
|       else { | ||||
|         alert.error(i18n.t("general.clipboard-not-supported") as string); | ||||
|       } | ||||
|     } | ||||
|  | ||||
|     async function shareRecipe(token: string) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user