From 01b5f35f1daa62000078a46fce6e92e484e8a0ef Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 24 Feb 2023 12:20:31 +0800 Subject: [PATCH 1/2] Fix instance is actually object --- src/components/compose.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index dd1b2dd9..97247e3c 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -105,7 +105,7 @@ function Compose({ hasOpener, }) { console.warn('RENDER COMPOSER'); - const { masto } = api(); + const { masto, instance } = api(); const [uiState, setUIState] = useState('default'); const UID = useRef(draftStatus?.uid || uid()); console.log('Compose UID', UID.current); @@ -113,8 +113,7 @@ function Compose({ const currentAccount = getCurrentAccount(); const currentAccountInfo = currentAccount.info; - const instance = getCurrentInstance(); - const { configuration } = instance; + const { configuration } = getCurrentInstance(); console.log('⚙️ Configuration', configuration); const { From b7f80fb621d56a8899f3c35cf6afce2e7950168a Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Fri, 24 Feb 2023 12:25:05 +0800 Subject: [PATCH 2/2] Fix masto undefined --- src/components/compose.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/compose.jsx b/src/components/compose.jsx index 97247e3c..848e8c8f 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -1039,6 +1039,7 @@ function Compose({ } const Textarea = forwardRef((props, ref) => { + const { masto } = api(); const [text, setText] = useState(ref.current?.value || ''); const { maxCharacters, performSearch = () => {}, ...textareaProps } = props; const snapStates = useSnapshot(states);