Fix passed arguments for sharing text

This commit is contained in:
Daniel Pham 2023-03-28 00:42:30 +02:00 committed by schlagmichdoch
parent 34ebd60304
commit 10a0aaf896
2 changed files with 2 additions and 2 deletions

View file

@ -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('/');
}

View file

@ -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('/');
}