about summary refs log tree commit diff
path: root/src/view/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/screens')
-rw-r--r--src/view/screens/ModerationBlockedAccounts.tsx5
-rw-r--r--src/view/screens/ModerationMutedAccounts.tsx5
-rw-r--r--src/view/screens/Notifications.tsx3
-rw-r--r--src/view/screens/PostThread.tsx3
-rw-r--r--src/view/screens/Profile.tsx9
-rw-r--r--src/view/screens/ProfileFeed.tsx13
-rw-r--r--src/view/screens/ProfileList.tsx5
-rw-r--r--src/view/screens/SavedFeeds.tsx14
-rw-r--r--src/view/screens/Settings.tsx8
9 files changed, 36 insertions, 29 deletions
diff --git a/src/view/screens/ModerationBlockedAccounts.tsx b/src/view/screens/ModerationBlockedAccounts.tsx
index a32c5e36e..f302c96b5 100644
--- a/src/view/screens/ModerationBlockedAccounts.tsx
+++ b/src/view/screens/ModerationBlockedAccounts.tsx
@@ -21,6 +21,7 @@ import {useFocusEffect} from '@react-navigation/native'
 import {ViewHeader} from '../com/util/ViewHeader'
 import {CenteredView} from 'view/com/util/Views'
 import {ProfileCard} from 'view/com/profile/ProfileCard'
+import {logger} from '#/logger'
 
 type Props = NativeStackScreenProps<
   CommonNavigatorParams,
@@ -52,9 +53,9 @@ export const ModerationBlockedAccounts = withAuthRequired(
       blockedAccounts
         .loadMore()
         .catch(err =>
-          store.log.error('Failed to load more blocked accounts', {error: err}),
+          logger.error('Failed to load more blocked accounts', {error: err}),
         )
-    }, [blockedAccounts, store])
+    }, [blockedAccounts])
 
     const renderItem = ({
       item,
diff --git a/src/view/screens/ModerationMutedAccounts.tsx b/src/view/screens/ModerationMutedAccounts.tsx
index 61911717a..20bd21f37 100644
--- a/src/view/screens/ModerationMutedAccounts.tsx
+++ b/src/view/screens/ModerationMutedAccounts.tsx
@@ -21,6 +21,7 @@ import {useFocusEffect} from '@react-navigation/native'
 import {ViewHeader} from '../com/util/ViewHeader'
 import {CenteredView} from 'view/com/util/Views'
 import {ProfileCard} from 'view/com/profile/ProfileCard'
+import {logger} from '#/logger'
 
 type Props = NativeStackScreenProps<
   CommonNavigatorParams,
@@ -49,9 +50,9 @@ export const ModerationMutedAccounts = withAuthRequired(
       mutedAccounts
         .loadMore()
         .catch(err =>
-          store.log.error('Failed to load more muted accounts', {error: err}),
+          logger.error('Failed to load more muted accounts', {error: err}),
         )
-    }, [mutedAccounts, store])
+    }, [mutedAccounts])
 
     const renderItem = ({
       item,
diff --git a/src/view/screens/Notifications.tsx b/src/view/screens/Notifications.tsx
index b00bfb765..e1137ae9d 100644
--- a/src/view/screens/Notifications.tsx
+++ b/src/view/screens/Notifications.tsx
@@ -20,6 +20,7 @@ import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
 import {s, colors} from 'lib/styles'
 import {useAnalytics} from 'lib/analytics/analytics'
 import {isWeb} from 'platform/detection'
+import {logger} from '#/logger'
 
 type Props = NativeStackScreenProps<
   NotificationsTabNavigatorParams,
@@ -60,7 +61,7 @@ export const NotificationsScreen = withAuthRequired(
     useFocusEffect(
       React.useCallback(() => {
         store.shell.setMinimalShellMode(false)
-        store.log.debug('NotificationsScreen: Updating feed')
+        logger.debug('NotificationsScreen: Updating feed')
         const softResetSub = store.onScreenSoftReset(onPressLoadLatest)
         store.me.notifications.update()
         screen('Notifications')
diff --git a/src/view/screens/PostThread.tsx b/src/view/screens/PostThread.tsx
index 5f15adcc5..8bb279be8 100644
--- a/src/view/screens/PostThread.tsx
+++ b/src/view/screens/PostThread.tsx
@@ -14,6 +14,7 @@ import {s} from 'lib/styles'
 import {useSafeAreaInsets} from 'react-native-safe-area-context'
 import {clamp} from 'lodash'
 import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries'
+import {logger} from '#/logger'
 
 const SHELL_FOOTER_HEIGHT = 44
 
@@ -38,7 +39,7 @@ export const PostThreadScreen = withAuthRequired(
         InteractionManager.runAfterInteractions(() => {
           if (!view.hasLoaded && !view.isLoading) {
             view.setup().catch(err => {
-              store.log.error('Failed to fetch thread', {error: err})
+              logger.error('Failed to fetch thread', {error: err})
             })
           }
         })
diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx
index d353c411f..f183ebbc2 100644
--- a/src/view/screens/Profile.tsx
+++ b/src/view/screens/Profile.tsx
@@ -29,6 +29,7 @@ import {FeedSourceCard} from 'view/com/feeds/FeedSourceCard'
 import {FeedSourceModel} from 'state/models/content/feed-source'
 import {useSetTitle} from 'lib/hooks/useSetTitle'
 import {combinedDisplayName} from 'lib/strings/display-names'
+import {logger} from '#/logger'
 
 type Props = NativeStackScreenProps<CommonNavigatorParams, 'Profile'>
 export const ProfileScreen = withAuthRequired(
@@ -108,16 +109,16 @@ export const ProfileScreen = withAuthRequired(
       uiState
         .refresh()
         .catch((err: any) =>
-          store.log.error('Failed to refresh user profile', {error: err}),
+          logger.error('Failed to refresh user profile', {error: err}),
         )
-    }, [uiState, store])
+    }, [uiState])
     const onEndReached = React.useCallback(() => {
       uiState.loadMore().catch((err: any) =>
-        store.log.error('Failed to load more entries in user profile', {
+        logger.error('Failed to load more entries in user profile', {
           error: err,
         }),
       )
-    }, [uiState, store])
+    }, [uiState])
     const onPressTryAgain = React.useCallback(() => {
       uiState.setup()
     }, [uiState])
diff --git a/src/view/screens/ProfileFeed.tsx b/src/view/screens/ProfileFeed.tsx
index 253031ff4..6a3da665e 100644
--- a/src/view/screens/ProfileFeed.tsx
+++ b/src/view/screens/ProfileFeed.tsx
@@ -40,6 +40,7 @@ import {NavigationProp} from 'lib/routes/types'
 import {sanitizeHandle} from 'lib/strings/handles'
 import {makeProfileLink} from 'lib/routes/links'
 import {ComposeIcon2} from 'lib/icons'
+import {logger} from '#/logger'
 
 const SECTION_TITLES = ['Posts', 'About']
 
@@ -165,9 +166,9 @@ export const ProfileFeedScreenInner = observer(
         Toast.show(
           'There was an an issue updating your feeds, please check your internet connection and try again.',
         )
-        store.log.error('Failed up update feeds', {error: err})
+        logger.error('Failed up update feeds', {error: err})
       }
-    }, [store, feedInfo])
+    }, [feedInfo])
 
     const onToggleLiked = React.useCallback(async () => {
       Haptics.default()
@@ -181,19 +182,19 @@ export const ProfileFeedScreenInner = observer(
         Toast.show(
           'There was an an issue contacting the server, please check your internet connection and try again.',
         )
-        store.log.error('Failed up toggle like', {error: err})
+        logger.error('Failed up toggle like', {error: err})
       }
-    }, [store, feedInfo])
+    }, [feedInfo])
 
     const onTogglePinned = React.useCallback(async () => {
       Haptics.default()
       if (feedInfo) {
         feedInfo.togglePin().catch(e => {
           Toast.show('There was an issue contacting the server')
-          store.log.error('Failed to toggle pinned feed', {error: e})
+          logger.error('Failed to toggle pinned feed', {error: e})
         })
       }
-    }, [store, feedInfo])
+    }, [feedInfo])
 
     const onPressShare = React.useCallback(() => {
       const url = toShareUrl(`/profile/${handleOrDid}/feed/${rkey}`)
diff --git a/src/view/screens/ProfileList.tsx b/src/view/screens/ProfileList.tsx
index 7580dcf55..cfe9c4182 100644
--- a/src/view/screens/ProfileList.tsx
+++ b/src/view/screens/ProfileList.tsx
@@ -43,6 +43,7 @@ import {sanitizeHandle} from 'lib/strings/handles'
 import {makeProfileLink, makeListLink} from 'lib/routes/links'
 import {ComposeIcon2} from 'lib/icons'
 import {ListItems} from 'view/com/lists/ListItems'
+import {logger} from '#/logger'
 
 const SECTION_TITLES_CURATE = ['Posts', 'About']
 const SECTION_TITLES_MOD = ['About']
@@ -272,9 +273,9 @@ const Header = observer(function HeaderImpl({
     Haptics.default()
     list.togglePin().catch(e => {
       Toast.show('There was an issue contacting the server')
-      store.log.error('Failed to toggle pinned list', {error: e})
+      logger.error('Failed to toggle pinned list', {error: e})
     })
-  }, [store, list])
+  }, [list])
 
   const onSubscribeMute = useCallback(() => {
     store.shell.openModal({
diff --git a/src/view/screens/SavedFeeds.tsx b/src/view/screens/SavedFeeds.tsx
index 900bb06aa..18bbf06c6 100644
--- a/src/view/screens/SavedFeeds.tsx
+++ b/src/view/screens/SavedFeeds.tsx
@@ -26,6 +26,7 @@ import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
 import * as Toast from 'view/com/util/Toast'
 import {Haptics} from 'lib/haptics'
 import {TextLink} from 'view/com/util/Link'
+import {logger} from '#/logger'
 
 const HITSLOP_TOP = {
   top: 20,
@@ -159,31 +160,30 @@ const ListItem = observer(function ListItemImpl({
   item: FeedSourceModel
 }) {
   const pal = usePalette('default')
-  const store = useStores()
   const isPinned = item.isPinned
 
   const onTogglePinned = useCallback(() => {
     Haptics.default()
     item.togglePin().catch(e => {
       Toast.show('There was an issue contacting the server')
-      store.log.error('Failed to toggle pinned feed', {error: e})
+      logger.error('Failed to toggle pinned feed', {error: e})
     })
-  }, [item, store])
+  }, [item])
   const onPressUp = useCallback(
     () =>
       savedFeeds.movePinnedFeed(item, 'up').catch(e => {
         Toast.show('There was an issue contacting the server')
-        store.log.error('Failed to set pinned feed order', {error: e})
+        logger.error('Failed to set pinned feed order', {error: e})
       }),
-    [store, savedFeeds, item],
+    [savedFeeds, item],
   )
   const onPressDown = useCallback(
     () =>
       savedFeeds.movePinnedFeed(item, 'down').catch(e => {
         Toast.show('There was an issue contacting the server')
-        store.log.error('Failed to set pinned feed order', {error: e})
+        logger.error('Failed to set pinned feed order', {error: e})
       }),
-    [store, savedFeeds, item],
+    [savedFeeds, item],
   )
 
   return (
diff --git a/src/view/screens/Settings.tsx b/src/view/screens/Settings.tsx
index c2c6d1efa..3f498ba85 100644
--- a/src/view/screens/Settings.tsx
+++ b/src/view/screens/Settings.tsx
@@ -45,6 +45,7 @@ import {formatCount} from 'view/com/util/numeric/format'
 import Clipboard from '@react-native-clipboard/clipboard'
 import {makeProfileLink} from 'lib/routes/links'
 import {AccountDropdownBtn} from 'view/com/util/AccountDropdownBtn'
+import {logger} from '#/logger'
 
 // TEMPORARY (APP-700)
 // remove after backend testing finishes
@@ -110,10 +111,9 @@ export const SettingsScreen = withAuthRequired(
               Toast.show('Your handle has been updated')
             },
             err => {
-              store.log.error(
-                'Failed to reload from server after handle update',
-                {error: err},
-              )
+              logger.error('Failed to reload from server after handle update', {
+                error: err,
+              })
               setIsSwitching(false)
             },
           )