refactor past meeting

This commit is contained in:
Sara
2024-01-18 14:05:34 +01:00
parent fa4935c454
commit 69ae5b281e
7 changed files with 219 additions and 152 deletions

View File

@@ -10,9 +10,10 @@ import { faSpinner } from "@fortawesome/free-solid-svg-icons";
import { UpdateTranscript } from "../../api";
import { ShareMode, toShareMode } from "../../lib/shareMode";
import useApi from "../../lib/useApi";
type ShareLinkProps = {
transcriptId: string;
userId: string | null;
transcriptUserId: string | null;
shareMode: ShareMode;
};
@@ -24,16 +25,16 @@ const ShareLink = (props: ShareLinkProps) => {
const [isOwner, setIsOwner] = useState(false);
const [shareMode, setShareMode] = useState<ShareMode>(props.shareMode);
const [shareLoading, setShareLoading] = useState(false);
const userinfo = useFiefUserinfo();
const api = useApi();
const userId = useFiefUserinfo()?.sub;
useEffect(() => {
setCurrentUrl(window.location.href);
}, []);
useEffect(() => {
setIsOwner(!!(requireLogin && userinfo?.sub === props.userId));
}, [userinfo, props.userId]);
setIsOwner(!!(requireLogin && userId === props.transcriptUserId));
}, [userId, props.transcriptUserId]);
const handleCopyClick = () => {
if (inputRef.current) {