Skip to content

Commit

Permalink
Fix tool link encoding
Browse files Browse the repository at this point in the history
Makes it easier to share when pasting it in oder contexts outside the web browser.
  • Loading branch information
davelopez committed Feb 6, 2024
1 parent 71237cf commit 22d5071
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/components/Tool/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 22d5071

Please sign in to comment.