only activate paste-mode the first time a file is opened with PairDrop by looking for the url parameter on start and removing it afterwords.
This commit is contained in:
parent
442dbe704d
commit
c0c51c38b3
1 changed files with 3 additions and 1 deletions
|
@ -1287,7 +1287,8 @@ class WebShareTargetUI {
|
||||||
|
|
||||||
class WebFileHandlersUI {
|
class WebFileHandlersUI {
|
||||||
constructor() {
|
constructor() {
|
||||||
if ("launchQueue" in window) {
|
const urlParams = new URL(window.location).searchParams;
|
||||||
|
if (urlParams.has("file_handler") && "launchQueue" in window) {
|
||||||
launchQueue.setConsumer(async launchParams => {
|
launchQueue.setConsumer(async launchParams => {
|
||||||
console.log("Launched with: ", launchParams);
|
console.log("Launched with: ", launchParams);
|
||||||
if (!launchParams.files.length)
|
if (!launchParams.files.length)
|
||||||
|
@ -1303,6 +1304,7 @@ class WebFileHandlersUI {
|
||||||
Events.fire('activate-paste-mode', {files: files, text: ""})
|
Events.fire('activate-paste-mode', {files: files, text: ""})
|
||||||
launchParams = null;
|
launchParams = null;
|
||||||
});
|
});
|
||||||
|
window.history.replaceState({}, "Rewrite URL", '/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue