Tidy up code

This commit is contained in:
schlagmichdoch 2023-03-28 19:07:33 +02:00
parent 10a0aaf896
commit d0b2c81582
4 changed files with 50 additions and 46 deletions

View file

@ -1607,14 +1607,13 @@ class WebShareTargetUI {
let shareTargetText;
if (url) {
shareTargetText = url; // We share only the Link - no text. Because link-only text becomes clickable.
shareTargetText = url; // we share only the link - no text.
} else if (title && text) {
shareTargetText = title + '\r\n' + text;
} else {
shareTargetText = title + text;
}
console.log('Shared Target Text:', '"' + shareTargetText + '"');
Events.fire('activate-paste-mode', {files: [], text: shareTargetText})
} else if (share_target_type === "files") {
let openRequest = window.indexedDB.open('pairdrop_store')
@ -1629,10 +1628,10 @@ class WebShareTargetUI {
for (let i=0; i<fileObjects.length; i++) {
filesReceived.push(new File([fileObjects[i].buffer], fileObjects[i].name));
}
console.debug(filesReceived)
Events.fire('activate-paste-mode', {files: filesReceived, text: ""})
const clearRequest = store.clear()
clearRequest.onsuccess = _ => db.close();
Events.fire('activate-paste-mode', {files: filesReceived, text: ""})
}
}
}