Skip to content

Commit

Permalink
feat(ui): on share link use compare pages when 2 frameworks selected
Browse files Browse the repository at this point in the history
  • Loading branch information
matschik committed Mar 4, 2024
1 parent 38ccf6c commit 3680a5a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
if (frameworksSelected.length === 0) {
return;
}
const shareURL = `${location.origin}?f=${[...frameworksSelected].map((f) => f.id).join(",")}`;
let shareURL = `${location.origin}`;
if (frameworksSelected.length === 2) {
shareURL += `/compare/${[...frameworksSelected].map((f) => f.id).join("-vs-")}`;
} else {
shareURL += `?f=${[...frameworksSelected].map((f) => f.id).join(",")}`;
}
copyToClipboard(shareURL);
notifications.show({
title: `Framework selection link copied with ${[...frameworksSelected].map((f) => f.title).join(", ")}`,
Expand Down

0 comments on commit 3680a5a

Please sign in to comment.