Compare commits
No commits in common. "32256b3c0e6d11255d93d40d3f1bcbdea55c7273" and "a0acd0fd4660808f80c2af686a4e21e347c8f696" have entirely different histories.
32256b3c0e
...
a0acd0fd46
@ -1,6 +1,7 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { EngagementShareRecipe } from "../../services/EngagementService";
|
import { EngagementShareRecipe } from "../../services/EngagementService";
|
||||||
import { isApiError } from "../../types/api/error";
|
import { isApiError } from "../../types/api/error";
|
||||||
|
import { GetBackendUrl } from "../../services/environment";
|
||||||
import ROUTE_CONSTANTS from "../../types/routes";
|
import ROUTE_CONSTANTS from "../../types/routes";
|
||||||
|
|
||||||
|
|
||||||
@ -14,11 +15,8 @@ export default function ShareButton({ id }: ShareButtonProps) {
|
|||||||
const clickHandler = async () => {
|
const clickHandler = async () => {
|
||||||
if (clicked) return;
|
if (clicked) return;
|
||||||
|
|
||||||
console.log(window.location);
|
|
||||||
// Copy first, so it feels fast
|
// Copy first, so it feels fast
|
||||||
const url = `${window.location.origin}${ROUTE_CONSTANTS.Recipe(id)}`;
|
const url = `${GetBackendUrl()}${ROUTE_CONSTANTS.Recipe(id)}`;
|
||||||
|
|
||||||
|
|
||||||
await navigator.clipboard.writeText(url);
|
await navigator.clipboard.writeText(url);
|
||||||
|
|
||||||
const result = await EngagementShareRecipe(id);
|
const result = await EngagementShareRecipe(id);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user