Fix other error logs while I'm at it

This commit is contained in:
Eric Bailey 2023-11-04 12:58:50 -05:00
parent df0dcf32f9
commit 7e29ebbadb
40 changed files with 104 additions and 86 deletions

View file

@ -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) {

View file

@ -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()}`)
}
},