Skip to content

Commit

Permalink
Fix URL not updating correctly on share dialog window (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianUribe6 authored Jan 24, 2024
1 parent 362640b commit ae36791
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/front-end/src/app/DialogCollab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import {
} from "../components/Dialog";
import { UserAddIcon } from "../components/Icons";
import { IS_BROWSER } from "@/utils";
import { usePathname } from "next/navigation";

export default function DialogCollab() {
const fullUrl = getLocation();
const pathname = usePathname();
const fullUrl = `${getOrigin()}${pathname}`;

const copyToClipBoard = () => {
navigator.clipboard.writeText(fullUrl);
Expand Down Expand Up @@ -45,6 +47,6 @@ export default function DialogCollab() {
);
}

function getLocation() {
return IS_BROWSER ? window.location.href : "";
function getOrigin() {
return IS_BROWSER ? window.location.origin : "";
}

0 comments on commit ae36791

Please sign in to comment.