Fix immediate TS errors
This commit is contained in:
parent
5fd41ad5a2
commit
df0dcf32f9
19 changed files with 81 additions and 71 deletions
|
@ -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])
|
||||
|
||||
|
|
|
@ -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])
|
||||
|
||||
|
|
|
@ -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])
|
||||
|
||||
|
|
|
@ -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')
|
||||
},
|
||||
)
|
||||
|
|
|
@ -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})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue