From 22d507112c72839216490069484b5cee6a468ca6 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Tue, 6 Feb 2024 14:30:49 +0100 Subject: [PATCH] Fix tool link encoding Makes it easier to share when pasting it in oder contexts outside the web browser. --- client/src/components/Tool/utilities.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/components/Tool/utilities.js b/client/src/components/Tool/utilities.js index 1b0a6d5a0ad2..84f9d2bd3fd2 100644 --- a/client/src/components/Tool/utilities.js +++ b/client/src/components/Tool/utilities.js @@ -2,7 +2,9 @@ import { getAppRoot } from "onload/loadConfig"; import { copy } from "utils/clipboard"; export function copyLink(toolId, message) { - copy(`${window.location.origin + getAppRoot()}root?tool_id=${toolId}`, message); + const link = `${window.location.origin + getAppRoot()}root?tool_id=${toolId}`; + // Encode the link to handle special characters in tool id + copy(encodeURI(link), message); } export function copyId(toolId, message) {