Merge pull request #1813 from bluesky-social/eric/app-903-extract-logger-into-singleton
Add new logger
This commit is contained in:
commit
e49a3d8a56
70 changed files with 1109 additions and 176 deletions
|
@ -83,7 +83,7 @@ export const Login = ({onPressBack}: {onPressBack: () => void}) => {
|
|||
}
|
||||
store.log.warn(
|
||||
`Failed to fetch service description for ${serviceUrl}`,
|
||||
err,
|
||||
{error: err},
|
||||
)
|
||||
setError(
|
||||
'Unable to contact your service. Please check your Internet connection.',
|
||||
|
@ -349,7 +349,7 @@ const LoginForm = ({
|
|||
})
|
||||
} catch (e: any) {
|
||||
const errMsg = e.toString()
|
||||
store.log.warn('Failed to login', e)
|
||||
store.log.warn('Failed to login', {error: e})
|
||||
setIsProcessing(false)
|
||||
if (errMsg.includes('Authentication Required')) {
|
||||
setError('Invalid username or password')
|
||||
|
@ -578,7 +578,7 @@ const ForgotPasswordForm = ({
|
|||
onEmailSent()
|
||||
} catch (e: any) {
|
||||
const errMsg = e.toString()
|
||||
store.log.warn('Failed to request password reset', e)
|
||||
store.log.warn('Failed to request password reset', {error: e})
|
||||
setIsProcessing(false)
|
||||
if (isNetworkError(e)) {
|
||||
setError(
|
||||
|
@ -734,7 +734,7 @@ const SetNewPasswordForm = ({
|
|||
onPasswordSet()
|
||||
} catch (e: any) {
|
||||
const errMsg = e.toString()
|
||||
store.log.warn('Failed to set new password', e)
|
||||
store.log.warn('Failed to set new password', {error: e})
|
||||
setIsProcessing(false)
|
||||
if (isNetworkError(e)) {
|
||||
setError(
|
||||
|
|
|
@ -39,7 +39,7 @@ export function OpenCameraBtn({gallery}: Props) {
|
|||
gallery.add(img)
|
||||
} catch (err: any) {
|
||||
// ignore
|
||||
store.log.warn('Error using camera', err)
|
||||
store.log.warn('Error using camera', {error: err})
|
||||
}
|
||||
}, [gallery, track, store, requestCameraAccessIfNeeded])
|
||||
|
||||
|
|
|
@ -46,7 +46,9 @@ export function useExternalLinkFetch({
|
|||
setExtLink(undefined)
|
||||
},
|
||||
err => {
|
||||
store.log.error('Failed to fetch post for quote embedding', {err})
|
||||
store.log.error('Failed to fetch post for quote embedding', {
|
||||
error: err,
|
||||
})
|
||||
setExtLink(undefined)
|
||||
},
|
||||
)
|
||||
|
@ -64,7 +66,7 @@ export function useExternalLinkFetch({
|
|||
})
|
||||
},
|
||||
err => {
|
||||
store.log.error('Failed to fetch feed for embedding', {err})
|
||||
store.log.error('Failed to fetch feed for embedding', {error: err})
|
||||
setExtLink(undefined)
|
||||
},
|
||||
)
|
||||
|
@ -82,7 +84,7 @@ export function useExternalLinkFetch({
|
|||
})
|
||||
},
|
||||
err => {
|
||||
store.log.error('Failed to fetch list for embedding', {err})
|
||||
store.log.error('Failed to fetch list for embedding', {error: err})
|
||||
setExtLink(undefined)
|
||||
},
|
||||
)
|
||||
|
|
|
@ -45,7 +45,7 @@ export const FeedSourceCard = observer(function FeedSourceCardImpl({
|
|||
Toast.show('Removed from my feeds')
|
||||
} catch (e) {
|
||||
Toast.show('There was an issue contacting your server')
|
||||
store.log.error('Failed to unsave feed', {e})
|
||||
store.log.error('Failed to unsave feed', {error: e})
|
||||
}
|
||||
},
|
||||
})
|
||||
|
@ -55,7 +55,7 @@ export const FeedSourceCard = observer(function FeedSourceCardImpl({
|
|||
Toast.show('Added to my feeds')
|
||||
} catch (e) {
|
||||
Toast.show('There was an issue contacting your server')
|
||||
store.log.error('Failed to save feed', {e})
|
||||
store.log.error('Failed to save feed', {error: e})
|
||||
}
|
||||
}
|
||||
}, [store, item])
|
||||
|
|
|
@ -94,7 +94,7 @@ export const ListItems = observer(function ListItemsImpl({
|
|||
try {
|
||||
await list.refresh()
|
||||
} catch (err) {
|
||||
list.rootStore.log.error('Failed to refresh lists', err)
|
||||
list.rootStore.log.error('Failed to refresh lists', {error: err})
|
||||
}
|
||||
setIsRefreshing(false)
|
||||
}, [list, track, setIsRefreshing])
|
||||
|
@ -104,7 +104,7 @@ export const ListItems = observer(function ListItemsImpl({
|
|||
try {
|
||||
await list.loadMore()
|
||||
} catch (err) {
|
||||
list.rootStore.log.error('Failed to load more lists', err)
|
||||
list.rootStore.log.error('Failed to load more lists', {error: err})
|
||||
}
|
||||
}, [list, track])
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ export const ListsList = observer(function ListsListImpl({
|
|||
try {
|
||||
await listsList.refresh()
|
||||
} catch (err) {
|
||||
listsList.rootStore.log.error('Failed to refresh lists', err)
|
||||
listsList.rootStore.log.error('Failed to refresh lists', {error: err})
|
||||
}
|
||||
setIsRefreshing(false)
|
||||
}, [listsList, track, setIsRefreshing])
|
||||
|
@ -88,7 +88,7 @@ export const ListsList = observer(function ListsListImpl({
|
|||
try {
|
||||
await listsList.loadMore()
|
||||
} catch (err) {
|
||||
listsList.rootStore.log.error('Failed to load more lists', err)
|
||||
listsList.rootStore.log.error('Failed to load more lists', {error: err})
|
||||
}
|
||||
}, [listsList, track])
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ export function Component({}: {}) {
|
|||
}
|
||||
} catch (e) {
|
||||
Toast.show('Failed to create app password.')
|
||||
store.log.error('Failed to create app password', {e})
|
||||
store.log.error('Failed to create app password', {error: e})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ export function Component({onChanged}: {onChanged: () => void}) {
|
|||
`Failed to fetch service description for ${String(
|
||||
store.agent.service,
|
||||
)}`,
|
||||
err,
|
||||
{error: err},
|
||||
)
|
||||
setError(
|
||||
'Unable to contact your service. Please check your Internet connection.',
|
||||
|
@ -113,7 +113,7 @@ export function Component({onChanged}: {onChanged: () => void}) {
|
|||
onChanged()
|
||||
} catch (err: any) {
|
||||
setError(cleanError(err))
|
||||
store.log.error('Failed to update handle', {handle, err})
|
||||
store.log.error('Failed to update handle', {handle, error: err})
|
||||
} finally {
|
||||
setProcessing(false)
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ function CustomHandleForm({
|
|||
}
|
||||
} catch (err: any) {
|
||||
setError(cleanError(err))
|
||||
store.log.error('Failed to verify domain', {handle, err})
|
||||
store.log.error('Failed to verify domain', {handle, error: err})
|
||||
} finally {
|
||||
setIsVerifying(false)
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ const AdultContentEnabledPref = observer(
|
|||
Toast.show(
|
||||
'There was an issue syncing your preferences with the server',
|
||||
)
|
||||
store.log.error('Failed to update preferences with server', {e})
|
||||
store.log.error('Failed to update preferences with server', {error: e})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,7 +168,7 @@ const ContentLabelPref = observer(function ContentLabelPrefImpl({
|
|||
Toast.show(
|
||||
'There was an issue syncing your preferences with the server',
|
||||
)
|
||||
store.log.error('Failed to update preferences with server', {e})
|
||||
store.log.error('Failed to update preferences with server', {error: e})
|
||||
}
|
||||
},
|
||||
[store, group],
|
||||
|
|
|
@ -62,7 +62,7 @@ export const Component = observer(function UserAddRemoveListsImpl({
|
|||
setMembershipsLoaded(true)
|
||||
},
|
||||
err => {
|
||||
store.log.error('Failed to fetch memberships', {err})
|
||||
store.log.error('Failed to fetch memberships', {error: err})
|
||||
},
|
||||
)
|
||||
}, [memberships, listsList, store, setSelected, setMembershipsLoaded])
|
||||
|
@ -76,7 +76,7 @@ export const Component = observer(function UserAddRemoveListsImpl({
|
|||
try {
|
||||
changes = await memberships.updateTo(selected)
|
||||
} catch (err) {
|
||||
store.log.error('Failed to update memberships', {err})
|
||||
store.log.error('Failed to update memberships', {error: err})
|
||||
return
|
||||
}
|
||||
Toast.show('Lists updated')
|
||||
|
|
|
@ -61,7 +61,9 @@ export const Feed = observer(function Feed({
|
|||
setIsPTRing(true)
|
||||
await view.refresh()
|
||||
} catch (err) {
|
||||
view.rootStore.log.error('Failed to refresh notifications feed', err)
|
||||
view.rootStore.log.error('Failed to refresh notifications feed', {
|
||||
error: err,
|
||||
})
|
||||
} finally {
|
||||
setIsPTRing(false)
|
||||
}
|
||||
|
@ -71,7 +73,9 @@ export const Feed = observer(function Feed({
|
|||
try {
|
||||
await view.loadMore()
|
||||
} catch (err) {
|
||||
view.rootStore.log.error('Failed to load more notifications', err)
|
||||
view.rootStore.log.error('Failed to load more notifications', {
|
||||
error: err,
|
||||
})
|
||||
}
|
||||
}, [view])
|
||||
|
||||
|
|
|
@ -18,7 +18,9 @@ export const PostLikedBy = observer(function PostLikedByImpl({
|
|||
const view = React.useMemo(() => new LikesModel(store, {uri}), [store, uri])
|
||||
|
||||
useEffect(() => {
|
||||
view.loadMore().catch(err => store.log.error('Failed to fetch likes', err))
|
||||
view
|
||||
.loadMore()
|
||||
.catch(err => store.log.error('Failed to fetch likes', {error: err}))
|
||||
}, [view, store.log])
|
||||
|
||||
const onRefresh = () => {
|
||||
|
@ -27,7 +29,9 @@ export const PostLikedBy = observer(function PostLikedByImpl({
|
|||
const onEndReached = () => {
|
||||
view
|
||||
.loadMore()
|
||||
.catch(err => view?.rootStore.log.error('Failed to load more likes', err))
|
||||
.catch(err =>
|
||||
view?.rootStore.log.error('Failed to load more likes', {error: err}),
|
||||
)
|
||||
}
|
||||
|
||||
if (!view.hasLoaded) {
|
||||
|
|
|
@ -23,7 +23,7 @@ export const PostRepostedBy = observer(function PostRepostedByImpl({
|
|||
useEffect(() => {
|
||||
view
|
||||
.loadMore()
|
||||
.catch(err => store.log.error('Failed to fetch reposts', err))
|
||||
.catch(err => store.log.error('Failed to fetch reposts', {error: err}))
|
||||
}, [view, store.log])
|
||||
|
||||
const onRefresh = () => {
|
||||
|
@ -33,7 +33,7 @@ export const PostRepostedBy = observer(function PostRepostedByImpl({
|
|||
view
|
||||
.loadMore()
|
||||
.catch(err =>
|
||||
view?.rootStore.log.error('Failed to load more reposts', err),
|
||||
view?.rootStore.log.error('Failed to load more reposts', {error: err}),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ export const PostThread = observer(function PostThread({
|
|||
try {
|
||||
view?.refresh()
|
||||
} catch (err) {
|
||||
view.rootStore.log.error('Failed to refresh posts thread', err)
|
||||
view.rootStore.log.error('Failed to refresh posts thread', {error: err})
|
||||
}
|
||||
setIsRefreshing(false)
|
||||
}, [view, setIsRefreshing])
|
||||
|
|
|
@ -111,13 +111,13 @@ export const PostThreadItem = observer(function PostThreadItem({
|
|||
const onPressToggleRepost = React.useCallback(() => {
|
||||
return item
|
||||
.toggleRepost()
|
||||
.catch(e => store.log.error('Failed to toggle repost', e))
|
||||
.catch(e => store.log.error('Failed to toggle repost', {error: e}))
|
||||
}, [item, store])
|
||||
|
||||
const onPressToggleLike = React.useCallback(() => {
|
||||
return item
|
||||
.toggleLike()
|
||||
.catch(e => store.log.error('Failed to toggle like', e))
|
||||
.catch(e => store.log.error('Failed to toggle like', {error: e}))
|
||||
}, [item, store])
|
||||
|
||||
const onCopyPostText = React.useCallback(() => {
|
||||
|
@ -138,7 +138,7 @@ export const PostThreadItem = observer(function PostThreadItem({
|
|||
Toast.show('You will now receive notifications for this thread')
|
||||
}
|
||||
} catch (e) {
|
||||
store.log.error('Failed to toggle thread mute', e)
|
||||
store.log.error('Failed to toggle thread mute', {error: e})
|
||||
}
|
||||
}, [item, store])
|
||||
|
||||
|
@ -149,7 +149,7 @@ export const PostThreadItem = observer(function PostThreadItem({
|
|||
Toast.show('Post deleted')
|
||||
},
|
||||
e => {
|
||||
store.log.error('Failed to delete post', e)
|
||||
store.log.error('Failed to delete post', {error: e})
|
||||
Toast.show('Failed to delete post, please try again')
|
||||
},
|
||||
)
|
||||
|
|
|
@ -142,13 +142,13 @@ const PostLoaded = observer(function PostLoadedImpl({
|
|||
const onPressToggleRepost = React.useCallback(() => {
|
||||
return item
|
||||
.toggleRepost()
|
||||
.catch(e => store.log.error('Failed to toggle repost', e))
|
||||
.catch(e => store.log.error('Failed to toggle repost', {error: e}))
|
||||
}, [item, store])
|
||||
|
||||
const onPressToggleLike = React.useCallback(() => {
|
||||
return item
|
||||
.toggleLike()
|
||||
.catch(e => store.log.error('Failed to toggle like', e))
|
||||
.catch(e => store.log.error('Failed to toggle like', {error: e}))
|
||||
}, [item, store])
|
||||
|
||||
const onCopyPostText = React.useCallback(() => {
|
||||
|
@ -169,7 +169,7 @@ const PostLoaded = observer(function PostLoadedImpl({
|
|||
Toast.show('You will now receive notifications for this thread')
|
||||
}
|
||||
} catch (e) {
|
||||
store.log.error('Failed to toggle thread mute', e)
|
||||
store.log.error('Failed to toggle thread mute', {error: e})
|
||||
}
|
||||
}, [item, store])
|
||||
|
||||
|
@ -180,7 +180,7 @@ const PostLoaded = observer(function PostLoadedImpl({
|
|||
Toast.show('Post deleted')
|
||||
},
|
||||
e => {
|
||||
store.log.error('Failed to delete post', e)
|
||||
store.log.error('Failed to delete post', {error: e})
|
||||
Toast.show('Failed to delete post, please try again')
|
||||
},
|
||||
)
|
||||
|
|
|
@ -92,7 +92,7 @@ export const Feed = observer(function Feed({
|
|||
try {
|
||||
await feed.refresh()
|
||||
} catch (err) {
|
||||
feed.rootStore.log.error('Failed to refresh posts feed', err)
|
||||
feed.rootStore.log.error('Failed to refresh posts feed', {error: err})
|
||||
}
|
||||
setIsRefreshing(false)
|
||||
}, [feed, track, setIsRefreshing])
|
||||
|
@ -104,7 +104,7 @@ export const Feed = observer(function Feed({
|
|||
try {
|
||||
await feed.loadMore()
|
||||
} catch (err) {
|
||||
feed.rootStore.log.error('Failed to load more posts', err)
|
||||
feed.rootStore.log.error('Failed to load more posts', {error: err})
|
||||
}
|
||||
}, [feed, track])
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ function FeedgenErrorMessage({
|
|||
Toast.show(
|
||||
'There was an an issue removing this feed. Please check your internet connection and try again.',
|
||||
)
|
||||
store.log.error('Failed to remove feed', {err})
|
||||
store.log.error('Failed to remove feed', {error: err})
|
||||
}
|
||||
},
|
||||
onPressCancel() {
|
||||
|
|
|
@ -94,14 +94,14 @@ export const FeedItem = observer(function FeedItemImpl({
|
|||
track('FeedItem:PostRepost')
|
||||
return item
|
||||
.toggleRepost()
|
||||
.catch(e => store.log.error('Failed to toggle repost', e))
|
||||
.catch(e => store.log.error('Failed to toggle repost', {error: e}))
|
||||
}, [track, item, store])
|
||||
|
||||
const onPressToggleLike = React.useCallback(() => {
|
||||
track('FeedItem:PostLike')
|
||||
return item
|
||||
.toggleLike()
|
||||
.catch(e => store.log.error('Failed to toggle like', e))
|
||||
.catch(e => store.log.error('Failed to toggle like', {error: e}))
|
||||
}, [track, item, store])
|
||||
|
||||
const onCopyPostText = React.useCallback(() => {
|
||||
|
@ -123,7 +123,7 @@ export const FeedItem = observer(function FeedItemImpl({
|
|||
Toast.show('You will now receive notifications for this thread')
|
||||
}
|
||||
} catch (e) {
|
||||
store.log.error('Failed to toggle thread mute', e)
|
||||
store.log.error('Failed to toggle thread mute', {error: e})
|
||||
}
|
||||
}, [track, item, store])
|
||||
|
||||
|
@ -135,7 +135,7 @@ export const FeedItem = observer(function FeedItemImpl({
|
|||
Toast.show('Post deleted')
|
||||
},
|
||||
e => {
|
||||
store.log.error('Failed to delete post', e)
|
||||
store.log.error('Failed to delete post', {error: e})
|
||||
Toast.show('Failed to delete post, please try again')
|
||||
},
|
||||
)
|
||||
|
|
|
@ -26,18 +26,20 @@ export const ProfileFollowers = observer(function ProfileFollowers({
|
|||
useEffect(() => {
|
||||
view
|
||||
.loadMore()
|
||||
.catch(err => store.log.error('Failed to fetch user followers', err))
|
||||
.catch(err =>
|
||||
store.log.error('Failed to fetch user followers', {error: err}),
|
||||
)
|
||||
}, [view, store.log])
|
||||
|
||||
const onRefresh = () => {
|
||||
view.refresh()
|
||||
}
|
||||
const onEndReached = () => {
|
||||
view
|
||||
.loadMore()
|
||||
.catch(err =>
|
||||
view?.rootStore.log.error('Failed to load more followers', err),
|
||||
)
|
||||
view.loadMore().catch(err =>
|
||||
view?.rootStore.log.error('Failed to load more followers', {
|
||||
error: err,
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
if (!view.hasLoaded) {
|
||||
|
|
|
@ -150,7 +150,7 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoadedImpl({
|
|||
: 'ProfileHeader:UnfollowButtonClicked',
|
||||
)
|
||||
},
|
||||
err => store.log.error('Failed to toggle follow', err),
|
||||
err => store.log.error('Failed to toggle follow', {error: err}),
|
||||
)
|
||||
}, [track, view, store.log, setShowSuggestedFollows])
|
||||
|
||||
|
@ -193,7 +193,7 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoadedImpl({
|
|||
await view.muteAccount()
|
||||
Toast.show('Account muted')
|
||||
} catch (e: any) {
|
||||
store.log.error('Failed to mute account', e)
|
||||
store.log.error('Failed to mute account', {error: e})
|
||||
Toast.show(`There was an issue! ${e.toString()}`)
|
||||
}
|
||||
}, [track, view, store])
|
||||
|
@ -204,7 +204,7 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoadedImpl({
|
|||
await view.unmuteAccount()
|
||||
Toast.show('Account unmuted')
|
||||
} catch (e: any) {
|
||||
store.log.error('Failed to unmute account', e)
|
||||
store.log.error('Failed to unmute account', {error: e})
|
||||
Toast.show(`There was an issue! ${e.toString()}`)
|
||||
}
|
||||
}, [track, view, store])
|
||||
|
@ -222,7 +222,7 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoadedImpl({
|
|||
onRefreshAll()
|
||||
Toast.show('Account blocked')
|
||||
} catch (e: any) {
|
||||
store.log.error('Failed to block account', e)
|
||||
store.log.error('Failed to block account', {error: e})
|
||||
Toast.show(`There was an issue! ${e.toString()}`)
|
||||
}
|
||||
},
|
||||
|
@ -242,7 +242,7 @@ const ProfileHeaderLoaded = observer(function ProfileHeaderLoadedImpl({
|
|||
onRefreshAll()
|
||||
Toast.show('Account unblocked')
|
||||
} catch (e: any) {
|
||||
store.log.error('Failed to unblock account', e)
|
||||
store.log.error('Failed to unblock account', {error: e})
|
||||
Toast.show(`There was an issue! ${e.toString()}`)
|
||||
}
|
||||
},
|
||||
|
|
|
@ -10,6 +10,7 @@ import {s} from 'lib/styles'
|
|||
import {ViewHeader} from '../com/util/ViewHeader'
|
||||
import {Text} from '../com/util/text/Text'
|
||||
import {usePalette} from 'lib/hooks/usePalette'
|
||||
import {getEntries} from '#/logger/logDump'
|
||||
import {ago} from 'lib/strings/time'
|
||||
|
||||
export const LogScreen = observer(function Log({}: NativeStackScreenProps<
|
||||
|
@ -38,9 +39,8 @@ export const LogScreen = observer(function Log({}: NativeStackScreenProps<
|
|||
<View style={[s.flex1]}>
|
||||
<ViewHeader title="Log" />
|
||||
<ScrollView style={s.flex1}>
|
||||
{store.log.entries
|
||||
{getEntries()
|
||||
.slice(0)
|
||||
.reverse()
|
||||
.map(entry => {
|
||||
return (
|
||||
<View key={`entry-${entry.id}`}>
|
||||
|
@ -49,15 +49,15 @@ export const LogScreen = observer(function Log({}: NativeStackScreenProps<
|
|||
onPress={toggler(entry.id)}
|
||||
accessibilityLabel="View debug entry"
|
||||
accessibilityHint="Opens additional details for a debug entry">
|
||||
{entry.type === 'debug' ? (
|
||||
{entry.level === 'debug' ? (
|
||||
<FontAwesomeIcon icon="info" />
|
||||
) : (
|
||||
<FontAwesomeIcon icon="exclamation" style={s.red3} />
|
||||
)}
|
||||
<Text type="sm" style={[styles.summary, pal.text]}>
|
||||
{entry.summary}
|
||||
{String(entry.message)}
|
||||
</Text>
|
||||
{entry.details ? (
|
||||
{entry.metadata && Object.keys(entry.metadata).length ? (
|
||||
<FontAwesomeIcon
|
||||
icon={
|
||||
expanded.includes(entry.id) ? 'angle-up' : 'angle-down'
|
||||
|
@ -66,14 +66,14 @@ export const LogScreen = observer(function Log({}: NativeStackScreenProps<
|
|||
/>
|
||||
) : undefined}
|
||||
<Text type="sm" style={[styles.ts, pal.textLight]}>
|
||||
{entry.ts ? ago(entry.ts) : ''}
|
||||
{ago(entry.timestamp)}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
{expanded.includes(entry.id) ? (
|
||||
<View style={[pal.view, s.pl10, s.pr10, s.pb10]}>
|
||||
<View style={[pal.btn, styles.details]}>
|
||||
<Text type="mono" style={pal.text}>
|
||||
{entry.details}
|
||||
{JSON.stringify(entry.metadata, null, 2)}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
|
|
@ -52,7 +52,7 @@ export const ModerationBlockedAccounts = withAuthRequired(
|
|||
blockedAccounts
|
||||
.loadMore()
|
||||
.catch(err =>
|
||||
store.log.error('Failed to load more blocked accounts', err),
|
||||
store.log.error('Failed to load more blocked accounts', {error: err}),
|
||||
)
|
||||
}, [blockedAccounts, store])
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ export const ModerationMutedAccounts = withAuthRequired(
|
|||
mutedAccounts
|
||||
.loadMore()
|
||||
.catch(err =>
|
||||
store.log.error('Failed to load more muted accounts', err),
|
||||
store.log.error('Failed to load more muted accounts', {error: err}),
|
||||
)
|
||||
}, [mutedAccounts, store])
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ export const PostThreadScreen = withAuthRequired(
|
|||
InteractionManager.runAfterInteractions(() => {
|
||||
if (!view.hasLoaded && !view.isLoading) {
|
||||
view.setup().catch(err => {
|
||||
store.log.error('Failed to fetch thread', err)
|
||||
store.log.error('Failed to fetch thread', {error: err})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
|
@ -108,15 +108,15 @@ export const ProfileScreen = withAuthRequired(
|
|||
uiState
|
||||
.refresh()
|
||||
.catch((err: any) =>
|
||||
store.log.error('Failed to refresh user profile', err),
|
||||
store.log.error('Failed to refresh user profile', {error: err}),
|
||||
)
|
||||
}, [uiState, store])
|
||||
const onEndReached = React.useCallback(() => {
|
||||
uiState
|
||||
.loadMore()
|
||||
.catch((err: any) =>
|
||||
store.log.error('Failed to load more entries in user profile', err),
|
||||
)
|
||||
uiState.loadMore().catch((err: any) =>
|
||||
store.log.error('Failed to load more entries in user profile', {
|
||||
error: err,
|
||||
}),
|
||||
)
|
||||
}, [uiState, store])
|
||||
const onPressTryAgain = React.useCallback(() => {
|
||||
uiState.setup()
|
||||
|
|
|
@ -165,7 +165,7 @@ 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', {err})
|
||||
store.log.error('Failed up update feeds', {error: err})
|
||||
}
|
||||
}, [store, feedInfo])
|
||||
|
||||
|
@ -181,7 +181,7 @@ 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', {err})
|
||||
store.log.error('Failed up toggle like', {error: err})
|
||||
}
|
||||
}, [store, feedInfo])
|
||||
|
||||
|
@ -190,7 +190,7 @@ export const ProfileFeedScreenInner = observer(
|
|||
if (feedInfo) {
|
||||
feedInfo.togglePin().catch(e => {
|
||||
Toast.show('There was an issue contacting the server')
|
||||
store.log.error('Failed to toggle pinned feed', {e})
|
||||
store.log.error('Failed to toggle pinned feed', {error: e})
|
||||
})
|
||||
}
|
||||
}, [store, feedInfo])
|
||||
|
|
|
@ -272,7 +272,7 @@ 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', {e})
|
||||
store.log.error('Failed to toggle pinned list', {error: e})
|
||||
})
|
||||
}, [store, list])
|
||||
|
||||
|
|
|
@ -166,14 +166,14 @@ const ListItem = observer(function ListItemImpl({
|
|||
Haptics.default()
|
||||
item.togglePin().catch(e => {
|
||||
Toast.show('There was an issue contacting the server')
|
||||
store.log.error('Failed to toggle pinned feed', {e})
|
||||
store.log.error('Failed to toggle pinned feed', {error: e})
|
||||
})
|
||||
}, [item, store])
|
||||
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', {e})
|
||||
store.log.error('Failed to set pinned feed order', {error: e})
|
||||
}),
|
||||
[store, savedFeeds, item],
|
||||
)
|
||||
|
@ -181,7 +181,7 @@ const ListItem = observer(function ListItemImpl({
|
|||
() =>
|
||||
savedFeeds.movePinnedFeed(item, 'down').catch(e => {
|
||||
Toast.show('There was an issue contacting the server')
|
||||
store.log.error('Failed to set pinned feed order', {e})
|
||||
store.log.error('Failed to set pinned feed order', {error: e})
|
||||
}),
|
||||
[store, savedFeeds, item],
|
||||
)
|
||||
|
|
|
@ -112,7 +112,7 @@ export const SettingsScreen = withAuthRequired(
|
|||
err => {
|
||||
store.log.error(
|
||||
'Failed to reload from server after handle update',
|
||||
{err},
|
||||
{error: err},
|
||||
)
|
||||
setIsSwitching(false)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue