Add more "instance" + saveStatus for new notifications

This commit is contained in:
Lim Chee Aun 2023-02-25 14:20:26 +08:00
parent 2afa84c2fd
commit 7b66b832d5
3 changed files with 8 additions and 4 deletions

View file

@ -175,7 +175,7 @@ function App() {
const notificationStream = useRef();
useEffect(() => {
if (isLoggedIn && visible) {
const { masto } = api();
const { masto, instance } = api();
(async () => {
// 1. Get the latest notification
if (states.notificationsLast) {
@ -200,6 +200,11 @@ function App() {
notificationStream.current.on('notification', (notification) => {
console.log('🔔🔔 Notification', notification);
if (notification.status) {
saveStatus(notification.status, instance, {
skipThreading: true,
});
}
states.notificationsShowNew = true;
});

View file

@ -772,7 +772,7 @@ function Compose({
editStatus.id,
params,
);
saveStatus(newStatus, {
saveStatus(newStatus, instance, {
skipThreading: true,
});
} else {

View file

@ -77,9 +77,8 @@ function Notifications() {
if (notifications?.length) {
notifications.forEach((notification) => {
saveStatus(notification.status, {
saveStatus(notification.status, instance, {
skipThreading: true,
override: false,
});
});