mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-21 22:54:53 +08:00
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:
@@ -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", '/');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user