From 1b6a2e9f55b61f87611c1bb8292b67fa32168cf3 Mon Sep 17 00:00:00 2001 From: Anthony Liddle Date: Tue, 3 Oct 2023 12:58:08 -0700 Subject: [PATCH 1/2] fix(discover): add share button and update api endpoint --- components/timeline/TimelineDiscover.vue | 12 ++++++++++++ server/api/[server]/recommendations.ts | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/components/timeline/TimelineDiscover.vue b/components/timeline/TimelineDiscover.vue index 9de45bb380..3d314ded99 100644 --- a/components/timeline/TimelineDiscover.vue +++ b/components/timeline/TimelineDiscover.vue @@ -18,6 +18,13 @@ function shorten(str: string, maxLen: number): string { function updateUTM(url: string): string { return url.replace('pocket-newtab', 'mozilla') } + +const clipboard = useClipboard() +async function copyLink(url, event) { + event.preventDefault() + if (url) + await clipboard.copy(url) +} diff --git a/server/api/[server]/recommendations.ts b/server/api/[server]/recommendations.ts index e037c770f4..d6ca5aec64 100644 --- a/server/api/[server]/recommendations.ts +++ b/server/api/[server]/recommendations.ts @@ -3,7 +3,7 @@ export default defineEventHandler(async (event) => { const { locale } = getQuery(event) const recommendations = await fetch( - `https://firefox-api-proxy.readitlater.com/desktop/v1/recommendations?consumer_key=moso-web-dev&locale=${locale}`, + `https://mozilla.social/content-feed/moso/v1/discover?locale=${locale}`, ) .then(response => response.json()) .then(response => response.data) From 860147d99ff5d28b3b6dd4ba0d4de02ea8aa041a Mon Sep 17 00:00:00 2001 From: Anthony Liddle Date: Tue, 3 Oct 2023 13:54:17 -0700 Subject: [PATCH 2/2] fix(discover): correct unocss margin on the div wrapping the share button --- components/timeline/TimelineDiscover.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/timeline/TimelineDiscover.vue b/components/timeline/TimelineDiscover.vue index 3d314ded99..6380d50cb0 100644 --- a/components/timeline/TimelineDiscover.vue +++ b/components/timeline/TimelineDiscover.vue @@ -55,7 +55,7 @@ async function copyLink(url, event) {
-
+