mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-24 00:36:17 -04:00
Tidy up code
This commit is contained in:
parent
10a0aaf896
commit
d0b2c81582
4 changed files with 50 additions and 46 deletions
|
@ -1608,14 +1608,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')
|
||||
|
@ -1630,10 +1629,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: ""})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue