From c9ef46d2bf7b468f0e2d7473af1668a1eaa7817d Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 7 Apr 2022 16:06:04 +0100 Subject: [PATCH] Fix spaces in screen URLs --- .../builderStore/store/screenTemplates/utils/sanitizeUrl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/store/screenTemplates/utils/sanitizeUrl.js b/packages/builder/src/builderStore/store/screenTemplates/utils/sanitizeUrl.js index e1c0485258..4d00c503fb 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/utils/sanitizeUrl.js +++ b/packages/builder/src/builderStore/store/screenTemplates/utils/sanitizeUrl.js @@ -3,13 +3,14 @@ export default function (url) { .split("/") .map(part => { part = decodeURIComponent(part) + part = part.replace(/ /g, "-") // If parameter, then use as is if (!part.startsWith(":")) { part = encodeURIComponent(part) } - return part.replace(/ /g, "-") + return part }) .join("/") .toLowerCase()