From d36a07febd610111b6f2cfb5794635cc6335f61c Mon Sep 17 00:00:00 2001 From: Nonumpa Date: Tue, 27 Jun 2023 15:01:49 +0800 Subject: [PATCH] feat(collab): add hint for not logged in user --- components/Collaborate/CollabEditor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/Collaborate/CollabEditor.js b/components/Collaborate/CollabEditor.js index 4b70fec3..5ddd364e 100644 --- a/components/Collaborate/CollabEditor.js +++ b/components/Collaborate/CollabEditor.js @@ -90,7 +90,9 @@ const CollabEditor = ({ article }) => { const [editorView, setEditorView] = useState(null); const currentUser = useCurrentUser(); const onTranscribe = () => { - if (!currentUser) return; + if (!currentUser) { + return alert(t`Please login first.`); + } const ydoc = new Y.Doc(); const permanentUserData = new Y.PermanentUserData(ydoc); permanentUserData.setUserMapping(ydoc, ydoc.clientID, currentUser.name);