Merge pull request '(FIX): Actually fixed it' (#67) from refactor/react into master
All checks were successful
Deploy application with Docker / build_and_deploy (push) Successful in 58s

Reviewed-on: #67
This commit is contained in:
Hayden Hargreaves 2026-01-08 22:32:52 -07:00
commit 32256b3c0e

View File

@ -1,7 +1,6 @@
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";
@ -15,8 +14,11 @@ 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 = `${GetBackendUrl()}${ROUTE_CONSTANTS.Recipe(id)}`; const url = `${window.location.origin}${ROUTE_CONSTANTS.Recipe(id)}`;
await navigator.clipboard.writeText(url); await navigator.clipboard.writeText(url);
const result = await EngagementShareRecipe(id); const result = await EngagementShareRecipe(id);