From c3cc75feffcfc5565513041e6f3b4bd07cf89f9e Mon Sep 17 00:00:00 2001 From: Marc-Andre Ferland Date: Thu, 3 Nov 2022 03:10:31 -0400 Subject: [PATCH] Adds a list of properties to not export by default. --- ui/media/js/dnd.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/media/js/dnd.js b/ui/media/js/dnd.js index e9f8276e..386dbdaa 100644 --- a/ui/media/js/dnd.js +++ b/ui/media/js/dnd.js @@ -351,6 +351,13 @@ function dragOverHandler(ev) { document.addEventListener("drop", dropHandler) document.addEventListener("dragover", dragOverHandler) +const TASK_REQ_NO_EXPORT = [ + "use_cpu", + "turbo", + "use_full_precision", + "save_to_disk_path" +] + // Adds a copy icon if the browser grants permission to write to clipboard. function checkWriteToClipboardPermission (result) { if (result.state == "granted" || result.state == "prompt") { @@ -361,7 +368,9 @@ function checkWriteToClipboardPermission (result) { copyIcon.innerHTML = `Copy Image Settings` copyIcon.addEventListener('click', (event) => { event.stopPropagation() - navigator.clipboard.writeText(JSON.stringify(readUI(), undefined, 4)) + const uiState = readUI() + TASK_REQ_NO_EXPORT.forEach((key) => delete uiState.reqBody[key]) + navigator.clipboard.writeText(JSON.stringify(uiState, undefined, 4)) }) resetSettings.parentNode.insertBefore(copyIcon, resetSettings) }