Make sure status link has instance too for toast

This commit is contained in:
Lim Chee Aun 2023-02-23 16:44:01 +08:00
parent 732244b4b3
commit 4b88c6ca65
2 changed files with 9 additions and 3 deletions

View file

@ -318,7 +318,7 @@ function App() {
null null
} }
onClose={(results) => { onClose={(results) => {
const { newStatus } = results || {}; const { newStatus, instance } = results || {};
states.showCompose = false; states.showCompose = false;
window.__COMPOSE__ = null; window.__COMPOSE__ = null;
if (newStatus) { if (newStatus) {
@ -334,7 +334,11 @@ function App() {
onClick: () => { onClick: () => {
toast.hideToast(); toast.hideToast();
states.prevLocation = location; states.prevLocation = location;
navigate(`/s/${newStatus.id}`); navigate(
instance
? `/${instance}/s/${newStatus.id}`
: `/s/${newStatus.id}`,
);
}, },
}); });
toast.showToast(); toast.showToast();

View file

@ -113,7 +113,8 @@ function Compose({
const currentAccount = getCurrentAccount(); const currentAccount = getCurrentAccount();
const currentAccountInfo = currentAccount.info; const currentAccountInfo = currentAccount.info;
const { configuration } = getCurrentInstance(); const instance = getCurrentInstance();
const { configuration } = instance;
console.log('⚙️ Configuration', configuration); console.log('⚙️ Configuration', configuration);
const { const {
@ -785,6 +786,7 @@ function Compose({
// Close // Close
onClose({ onClose({
newStatus, newStatus,
instance,
}); });
} catch (e) { } catch (e) {
console.error(e); console.error(e);