From b445c15cc99a56c2baf727d05cf53b44aef4542b Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Sun, 12 Nov 2023 18:13:11 -0800 Subject: Refactor notifications to use react-query (#1878) * Move broadcast channel to lib * Refactor view/com/post/Post and remove temporary 2 components * Add useModerationOpts hook * Refactor notifications to use react-query * Fix: only trigger updates in useModerationOpts when the values have changed * Implement unread notification tracking * Add moderation filtering to notifications * Handle native/push notifications * Remove dead code --------- Co-authored-by: Eric Bailey --- src/App.native.tsx | 63 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 30 deletions(-) (limited to 'src/App.native.tsx') diff --git a/src/App.native.tsx b/src/App.native.tsx index 8479465fd..e976fce4f 100644 --- a/src/App.native.tsx +++ b/src/App.native.tsx @@ -31,6 +31,7 @@ import { useSession, useSessionApi, } from 'state/session' +import {Provider as UnreadNotifsProvider} from 'state/queries/notifications/unread' import * as persisted from '#/state/persisted' import {i18n} from '@lingui/core' import {I18nProvider} from '@lingui/react' @@ -53,7 +54,7 @@ const InnerApp = observer(function AppImpl() { setupState().then(store => { setRootStore(store) analytics.init(store) - notifications.init(store) + notifications.init(store, queryClient) store.onSessionDropped(() => { Toast.show('Sorry! Your session expired. Please log in again.') }) @@ -72,22 +73,20 @@ const InnerApp = observer(function AppImpl() { } return ( - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + ) }) @@ -103,19 +102,23 @@ function App() { } return ( - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + ) } -- cgit 1.4.1