Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix: trailing slashes

flooorianfloa2a2d9709e14
diff --git a/apps/web/ui/modals/add-edit-link-modal/url-edit.tsx b/apps/web/ui/modals/add-edit-link-modal/url-edit.tsx
index 6c05d12a29..97f935efaf 100644
--- a/apps/web/ui/modals/add-edit-link-modal/url-edit.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal/url-edit.tsx
@@ -98,9 +98,12 @@ export default function URLEdit({ url, setURL }) {
setURL(newURL);
} else {
let newURL = url;
+
+ if (newURL.endsWith("/")) newURL = newURL.slice(0, -1);
+
Object.values(preset.settings).forEach((setting) => {
if (setting.slug !== name) {
- newURL = newURL.replace(setting.slug, "");
+ newURL = newURL.replace(`/${setting.slug}`, "");
}
});