Implement logging system

This commit is contained in:
Paul Frazee 2023-01-02 17:38:13 -06:00
parent 99cec71ed7
commit f6a0e634d7
39 changed files with 442 additions and 125 deletions

View file

@ -40,10 +40,8 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
return
}
if (hasSetup) {
console.log('Updating profile for', params.name)
uiState.update()
} else {
console.log('Fetching profile for', params.name)
store.nav.setTitle(navIdx, params.name)
uiState.setup().then(() => {
if (aborted) return
@ -64,12 +62,19 @@ export const Profile = observer(({navIdx, visible, params}: ScreenParams) => {
const onRefresh = () => {
uiState
.refresh()
.catch((err: any) => console.error('Failed to refresh', err))
.catch((err: any) =>
store.log.error('Failed to refresh user profile', err.toString()),
)
}
const onEndReached = () => {
uiState
.loadMore()
.catch((err: any) => console.error('Failed to load more', err))
.catch((err: any) =>
store.log.error(
'Failed to load more entries in user profile',
err.toString(),
),
)
}
const onPressTryAgain = () => {
uiState.setup()