refactor: http service (#2233)

This commit is contained in:
Mo
2023-02-28 20:43:25 -06:00
committed by GitHub
parent 6e7618b258
commit e7f1d35341
142 changed files with 1116 additions and 1307 deletions

View File

@@ -12,6 +12,7 @@ import Icon from '@/Components/Icon/Icon'
import IconButton from '@/Components/Button/IconButton'
import AdvancedOptions from './AdvancedOptions'
import HorizontalSeparator from '../Shared/HorizontalSeparator'
import { isErrorResponse } from '@standardnotes/snjs'
type Props = {
viewControllerManager: ViewControllerManager
@@ -96,9 +97,9 @@ const SignInPane: FunctionComponent<Props> = ({ application, viewControllerManag
application
.signIn(email, password, isStrictSignin, isEphemeral, shouldMergeLocal)
.then((res) => {
if (res.error) {
throw new Error(res.error.message)
.then((response) => {
if (isErrorResponse(response)) {
throw new Error(response.data?.error.message)
}
viewControllerManager.accountMenuController.closeAccountMenu()
})