From 4b88c6ca65a3512b98efa7289ccd8e85fdbd4eda Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Thu, 23 Feb 2023 16:44:01 +0800 Subject: [PATCH] Make sure status link has instance too for toast --- src/app.jsx | 8 ++++++-- src/components/compose.jsx | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app.jsx b/src/app.jsx index 038a33c7..113b74ae 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -318,7 +318,7 @@ function App() { null } onClose={(results) => { - const { newStatus } = results || {}; + const { newStatus, instance } = results || {}; states.showCompose = false; window.__COMPOSE__ = null; if (newStatus) { @@ -334,7 +334,11 @@ function App() { onClick: () => { toast.hideToast(); states.prevLocation = location; - navigate(`/s/${newStatus.id}`); + navigate( + instance + ? `/${instance}/s/${newStatus.id}` + : `/s/${newStatus.id}`, + ); }, }); toast.showToast(); diff --git a/src/components/compose.jsx b/src/components/compose.jsx index aea4d0da..dd1b2dd9 100644 --- a/src/components/compose.jsx +++ b/src/components/compose.jsx @@ -113,7 +113,8 @@ function Compose({ const currentAccount = getCurrentAccount(); const currentAccountInfo = currentAccount.info; - const { configuration } = getCurrentInstance(); + const instance = getCurrentInstance(); + const { configuration } = instance; console.log('⚙️ Configuration', configuration); const { @@ -785,6 +786,7 @@ function Compose({ // Close onClose({ newStatus, + instance, }); } catch (e) { console.error(e);