1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Restructure removing remote

This commit is contained in:
Zhiyuan Zheng
2021-02-20 19:12:44 +01:00
parent 9fdf3ab640
commit 45681fc1f5
71 changed files with 998 additions and 756 deletions

View File

@ -1,7 +1,7 @@
import { QueryKeyTimeline } from '@utils/queryHooks/timeline'
import {
getLocalInstance,
updateLocalNotification
getInstance,
updateInstanceNotification
} from '@utils/slices/instancesSlice'
import { useEffect, useRef } from 'react'
import { useQueryClient } from 'react-query'
@ -18,7 +18,7 @@ const useWebsocket = ({
const queryClient = useQueryClient()
const dispatch = useDispatch()
const localInstance = useSelector(
getLocalInstance,
getInstance,
(prev, next) =>
prev?.urls.streaming_api === next?.urls.streaming_api &&
prev?.token === next?.token
@ -39,7 +39,7 @@ const useWebsocket = ({
case 'notification':
const payload: Mastodon.Notification = JSON.parse(message.payload)
dispatch(
updateLocalNotification({ latestTime: payload.created_at })
updateInstanceNotification({ latestTime: payload.created_at })
)
const queryKey: QueryKeyTimeline = [
'Timeline',