Skip to content

Commit

Permalink
chore: remove redundant conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmFly committed Dec 23, 2024
1 parent 1f5959c commit a3b79d8
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions packages/frontend/core/src/modules/cloud/stores/auth.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import {
ErrorNames,
removeAvatarMutation,
updateUserProfileMutation,
uploadAvatarMutation,
UserFriendlyError,
} from '@affine/graphql';
import { Store } from '@toeverything/infra';

import type { GlobalState } from '../../storage';
import type { AuthSessionInfo } from '../entities/session';
import { BackendError } from '../error';
import type { FetchService } from '../services/fetch';
import type { GraphQLService } from '../services/graphql';
import type { ServerService } from '../services/server';
Expand Down Expand Up @@ -101,16 +98,6 @@ export class AuthStore extends Store {
},
});

if (!res.ok) {
const error = await res.json();

const userFriendlyError = UserFriendlyError.fromAnyError(error);
if (userFriendlyError.name === ErrorNames.UNSUPPORTED_CLIENT_VERSION) {
throw new BackendError(userFriendlyError, res.status);
}
throw new Error(`Failed to check user by email: ${email}`);
}

const data = (await res.json()) as {
registered: boolean;
hasPassword: boolean;
Expand Down

0 comments on commit a3b79d8

Please sign in to comment.