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
}
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();

View file

@ -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);