mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-26 03:05:41 +03:00
Add more "instance" + saveStatus for new notifications
This commit is contained in:
parent
2afa84c2fd
commit
7b66b832d5
3 changed files with 8 additions and 4 deletions
|
@ -175,7 +175,7 @@ function App() {
|
||||||
const notificationStream = useRef();
|
const notificationStream = useRef();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isLoggedIn && visible) {
|
if (isLoggedIn && visible) {
|
||||||
const { masto } = api();
|
const { masto, instance } = api();
|
||||||
(async () => {
|
(async () => {
|
||||||
// 1. Get the latest notification
|
// 1. Get the latest notification
|
||||||
if (states.notificationsLast) {
|
if (states.notificationsLast) {
|
||||||
|
@ -200,6 +200,11 @@ function App() {
|
||||||
|
|
||||||
notificationStream.current.on('notification', (notification) => {
|
notificationStream.current.on('notification', (notification) => {
|
||||||
console.log('🔔🔔 Notification', notification);
|
console.log('🔔🔔 Notification', notification);
|
||||||
|
if (notification.status) {
|
||||||
|
saveStatus(notification.status, instance, {
|
||||||
|
skipThreading: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
states.notificationsShowNew = true;
|
states.notificationsShowNew = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -772,7 +772,7 @@ function Compose({
|
||||||
editStatus.id,
|
editStatus.id,
|
||||||
params,
|
params,
|
||||||
);
|
);
|
||||||
saveStatus(newStatus, {
|
saveStatus(newStatus, instance, {
|
||||||
skipThreading: true,
|
skipThreading: true,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -77,9 +77,8 @@ function Notifications() {
|
||||||
|
|
||||||
if (notifications?.length) {
|
if (notifications?.length) {
|
||||||
notifications.forEach((notification) => {
|
notifications.forEach((notification) => {
|
||||||
saveStatus(notification.status, {
|
saveStatus(notification.status, instance, {
|
||||||
skipThreading: true,
|
skipThreading: true,
|
||||||
override: false,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue