diff --git a/src/App.tsx b/src/App.tsx index 2af2146d92..2f0a702039 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -126,9 +126,8 @@ function InnerApp() { } } catch (e) { logger.warn(`session: resume failed`, {message: e}) - } finally { - setIsReady(true) } + setIsReady(true) } const account = readLastActiveAccount() void onLaunch(account) diff --git a/src/App.web.tsx b/src/App.web.tsx index 8070c4d333..ef6ac5e4c5 100644 --- a/src/App.web.tsx +++ b/src/App.web.tsx @@ -105,9 +105,8 @@ function InnerApp() { } } catch (e) { logger.warn('session: resumeSession failed', {message: e}) - } finally { - setIsReady(true) } + setIsReady(true) } const account = readLastActiveAccount() void onLaunch(account) diff --git a/src/components/PostControls/PostMenu/PostMenuItems.tsx b/src/components/PostControls/PostMenu/PostMenuItems.tsx index 5cf9b0b5a4..cbe23d6724 100644 --- a/src/components/PostControls/PostMenu/PostMenuItems.tsx +++ b/src/components/PostControls/PostMenu/PostMenuItems.tsx @@ -429,14 +429,13 @@ let PostMenuItems = ({ type: 'error', }) } - } finally { - ax.metric('postMenu:blockAccount', { - uri: postUri, - authorDid: postAuthor.did, - logContext, - feedDescriptor: feedFeedback.feedDescriptor, - }) } + ax.metric('postMenu:blockAccount', { + uri: postUri, + authorDid: postAuthor.did, + logContext, + feedDescriptor: feedFeedback.feedDescriptor, + }) } const onMuteAuthor = async () => { @@ -452,14 +451,13 @@ let PostMenuItems = ({ type: 'error', }) } - } finally { - ax.metric('postMenu:unmuteAccount', { - uri: postUri, - authorDid: postAuthor.did, - logContext, - feedDescriptor: feedFeedback.feedDescriptor, - }) } + ax.metric('postMenu:unmuteAccount', { + uri: postUri, + authorDid: postAuthor.did, + logContext, + feedDescriptor: feedFeedback.feedDescriptor, + }) } else { try { await queueMute() @@ -472,14 +470,13 @@ let PostMenuItems = ({ type: 'error', }) } - } finally { - ax.metric('postMenu:muteAccount', { - uri: postUri, - authorDid: postAuthor.did, - logContext, - feedDescriptor: feedFeedback.feedDescriptor, - }) } + ax.metric('postMenu:muteAccount', { + uri: postUri, + authorDid: postAuthor.did, + logContext, + feedDescriptor: feedFeedback.feedDescriptor, + }) } } diff --git a/src/components/dialogs/DeviceLocationRequestDialog.tsx b/src/components/dialogs/DeviceLocationRequestDialog.tsx index 05d9d99539..9b40d60d52 100644 --- a/src/components/dialogs/DeviceLocationRequestDialog.tsx +++ b/src/components/dialogs/DeviceLocationRequestDialog.tsx @@ -95,9 +95,8 @@ function DeviceLocationRequestDialogInner({onLocationAcquired}: Props) { safeMessage: e.message, }) } - } finally { - setIsRequesting(false) } + setIsRequesting(false) } return ( diff --git a/src/components/dialogs/PostInteractionSettingsDialog.tsx b/src/components/dialogs/PostInteractionSettingsDialog.tsx index 4b04c9fefa..ac64ed331f 100644 --- a/src/components/dialogs/PostInteractionSettingsDialog.tsx +++ b/src/components/dialogs/PostInteractionSettingsDialog.tsx @@ -241,9 +241,8 @@ export function PostInteractionSettingsDialogControlledInner( type: 'error', }, ) - } finally { - setIsSaving(false) } + setIsSaving(false) }, [ _, ax, diff --git a/src/components/moderation/ReportDialog/index.tsx b/src/components/moderation/ReportDialog/index.tsx index f9d29831f0..7fa0426577 100644 --- a/src/components/moderation/ReportDialog/index.tsx +++ b/src/components/moderation/ReportDialog/index.tsx @@ -319,9 +319,8 @@ function Inner( type: 'setError', error, }) - } finally { - setIsPending(false) } + setIsPending(false) }, [logger, submitReport, props, state, ax, l, videoTimestampSeconds]) useCallOnce(() => { diff --git a/src/lib/hooks/useAccountSwitcher.ts b/src/lib/hooks/useAccountSwitcher.ts index 106e92d37a..7d21b8fcd5 100644 --- a/src/lib/hooks/useAccountSwitcher.ts +++ b/src/lib/hooks/useAccountSwitcher.ts @@ -54,9 +54,8 @@ export function useAccountSwitcher() { Toast.show(_(msg`Please sign in as @${account.handle}`), { type: 'warning', }) - } finally { - setPendingDid(null) } + setPendingDid(null) }, [_, ax, resumeSession, requestSwitchToAccount, pendingDid], ) diff --git a/src/screens/Deactivated.tsx b/src/screens/Deactivated.tsx index 3be42add78..90811232b5 100644 --- a/src/screens/Deactivated.tsx +++ b/src/screens/Deactivated.tsx @@ -95,9 +95,8 @@ export function Deactivated() { logger.error(e, { message: 'Failed to activate account', }) - } finally { - setPending(false) } + setPending(false) }, [_, pdsClient, refreshSession, setPending, setError, queryClient]) return ( diff --git a/src/screens/List/ListHiddenScreen.tsx b/src/screens/List/ListHiddenScreen.tsx index f562ad1d96..01c8fdab4a 100644 --- a/src/screens/List/ListHiddenScreen.tsx +++ b/src/screens/List/ListHiddenScreen.tsx @@ -103,9 +103,8 @@ export function ListHiddenScreen({ msg`There was an issue. Please check your internet connection and try again.`, ), ) - } finally { - setIsProcessing(false) } + setIsProcessing(false) } return ( diff --git a/src/screens/Login/ChooseAccountForm.tsx b/src/screens/Login/ChooseAccountForm.tsx index 317a3bcdc3..036384ede6 100644 --- a/src/screens/Login/ChooseAccountForm.tsx +++ b/src/screens/Login/ChooseAccountForm.tsx @@ -58,9 +58,8 @@ export const ChooseAccountForm = ({ }) // Move to login form. onSelectAccount(account) - } finally { - setPendingDid(null) } + setPendingDid(null) }, [ currentAccount, diff --git a/src/screens/Settings/components/ChangePasswordDialog.tsx b/src/screens/Settings/components/ChangePasswordDialog.tsx index 3015b402b5..f43c62f775 100644 --- a/src/screens/Settings/components/ChangePasswordDialog.tsx +++ b/src/screens/Settings/components/ChangePasswordDialog.tsx @@ -102,9 +102,8 @@ function Inner() { logger.error('Failed to request password reset', {safeMessage: e}) setError(cleanError(e)) } - } finally { - setIsProcessing(false) } + setIsProcessing(false) } const onChangePassword = async () => { @@ -151,9 +150,8 @@ function Inner() { logger.error('Failed to set new password', {safeMessage: e}) setError(cleanError(e)) } - } finally { - setIsProcessing(false) } + setIsProcessing(false) } const onBlur = () => { diff --git a/src/screens/Settings/components/DeactivateAccountDialog.tsx b/src/screens/Settings/components/DeactivateAccountDialog.tsx index eaae97659e..acb969601e 100644 --- a/src/screens/Settings/components/DeactivateAccountDialog.tsx +++ b/src/screens/Settings/components/DeactivateAccountDialog.tsx @@ -64,9 +64,8 @@ function DeactivateAccountDialogInner({ logger.error(e, { message: 'Failed to deactivate account', }) - } finally { - setPending(false) } + setPending(false) }, [client, control, logoutCurrentAccount, _, setPending]) return ( diff --git a/src/screens/Settings/components/DisableEmail2FADialog.tsx b/src/screens/Settings/components/DisableEmail2FADialog.tsx index c633c82029..a0a9f0126d 100644 --- a/src/screens/Settings/components/DisableEmail2FADialog.tsx +++ b/src/screens/Settings/components/DisableEmail2FADialog.tsx @@ -49,9 +49,8 @@ export function DisableEmail2FADialog({ setStage(Stages.ConfirmCode) } catch (e) { setError(cleanError(String(e))) - } finally { - setIsProcessing(false) } + setIsProcessing(false) } const onConfirmDisable = async () => { @@ -80,9 +79,8 @@ export function DisableEmail2FADialog({ } else { setError(cleanError(e)) } - } finally { - setIsProcessing(false) } + setIsProcessing(false) } return ( diff --git a/src/screens/Settings/components/ExportCarDialog.tsx b/src/screens/Settings/components/ExportCarDialog.tsx index 290f380157..402ffa29ed 100644 --- a/src/screens/Settings/components/ExportCarDialog.tsx +++ b/src/screens/Settings/components/ExportCarDialog.tsx @@ -53,9 +53,8 @@ export function ExportCarDialog({ } catch (e) { logger.error('Error occurred while downloading CAR file', {message: e}) Toast.show(l`Error occurred while saving file`, {type: 'error'}) - } finally { - setLoading(false) } + setLoading(false) }, [l, currentAccount, pdsClient]) const downloadChatData = useCallback(async () => { @@ -84,9 +83,8 @@ export function ExportCarDialog({ } catch (e) { logger.error('Error occurred while downloading chat data', {message: e}) Toast.show(l`Error occurred while saving file`, {type: 'error'}) - } finally { - setLoading(false) } + setLoading(false) }, [l, currentAccount, chatClient]) return ( diff --git a/src/screens/Signup/StepCaptcha/index.tsx b/src/screens/Signup/StepCaptcha/index.tsx index 43e536c7ae..cdf627abfb 100644 --- a/src/screens/Signup/StepCaptcha/index.tsx +++ b/src/screens/Signup/StepCaptcha/index.tsx @@ -51,9 +51,8 @@ export function StepCaptchaNative() { } catch (err) { const e = err as Error logger.error(e) - } finally { - setReady(true) } + setReady(true) })() }, []) diff --git a/src/screens/SignupQueued.tsx b/src/screens/SignupQueued.tsx index e0bf7f2edd..58a3793050 100644 --- a/src/screens/SignupQueued.tsx +++ b/src/screens/SignupQueued.tsx @@ -60,9 +60,8 @@ export function SignupQueued() { } } catch (e: any) { logger.error('Failed to check signup queue', {err: e.toString()}) - } finally { - setProcessing(false) } + setProcessing(false) }, [ setProcessing, setEstimatedTime, diff --git a/src/view/com/notifications/NotificationFeed.tsx b/src/view/com/notifications/NotificationFeed.tsx index 82b5008078..a6c60a72ec 100644 --- a/src/view/com/notifications/NotificationFeed.tsx +++ b/src/view/com/notifications/NotificationFeed.tsx @@ -103,9 +103,8 @@ export function NotificationFeed({ logger.error('Failed to refresh notifications feed', { message: err, }) - } finally { - setIsPTRing(false) } + setIsPTRing(false) }, [refreshNotifications, setIsPTRing]) const onEndReached = useCallback(async () => { diff --git a/src/view/com/notifications/NotificationFeedItem.tsx b/src/view/com/notifications/NotificationFeedItem.tsx index 0d56dfb873..502074a34a 100644 --- a/src/view/com/notifications/NotificationFeedItem.tsx +++ b/src/view/com/notifications/NotificationFeedItem.tsx @@ -920,9 +920,8 @@ function SayHelloBtn({profile}: {profile: app.bsky.actor.defs.ProfileView}) { }) } catch (e) { logger.error('Failed to get conversation', {safeMessage: e}) - } finally { - setIsLoading(false) } + setIsLoading(false) } if ( diff --git a/src/view/shell/desktop/LeftNav.tsx b/src/view/shell/desktop/LeftNav.tsx index 585a4afff5..7ad99d805f 100644 --- a/src/view/shell/desktop/LeftNav.tsx +++ b/src/view/shell/desktop/LeftNav.tsx @@ -559,9 +559,8 @@ function ComposeBtn({minimal}: {minimal: boolean}) { handle = await fetchHandle(handle) } catch (e) { handle = undefined - } finally { - setIsFetchingHandle(false) } + setIsFetchingHandle(false) } if (