From 10a0aaf896da283638c69160c4bad281f3f84e69 Mon Sep 17 00:00:00 2001 From: Daniel Pham Date: Tue, 28 Mar 2023 00:42:30 +0200 Subject: [PATCH] Fix passed arguments for sharing text --- public/service-worker.js | 2 +- public_included_ws_fallback/service-worker.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/service-worker.js b/public/service-worker.js index f49cc5f..7e43687 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -137,7 +137,7 @@ const evaluateRequestData = async function (request) { } } else if (title?.length > 0 || text?.length > 0 || url?.length > 0) { console.debug(title || text || url); - resolve(`/?share-target=text&title=${title}&text=${text}&url=${url}`); + resolve(`/?share-target=text${title ? `&title=${title}` : ''}${text ? `&text=${text}` : ''}${url ? `&url=${url}` : ''}`); } else { resolve('/'); } diff --git a/public_included_ws_fallback/service-worker.js b/public_included_ws_fallback/service-worker.js index acb7225..6e815eb 100644 --- a/public_included_ws_fallback/service-worker.js +++ b/public_included_ws_fallback/service-worker.js @@ -137,7 +137,7 @@ const evaluateRequestData = async function (request) { } } else if (title?.length > 0 || text?.length > 0 || url?.length > 0) { console.debug(title || text || url); - resolve(`/?share-target=text&title=${title}&text=${text}&url=${url}`); + resolve(`/?share-target=text${title ? `&title=${title}` : ''}${text ? `&text=${text}` : ''}${url ? `&url=${url}` : ''}`); } else { resolve('/'); }