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 24, 2024
1 parent 1f5959c commit 7399e3f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 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
4 changes: 2 additions & 2 deletions packages/frontend/i18n/src/resources/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@
"com.affine.payment.billing-setting.due-date": "Due date",
"com.affine.payment.billing-setting.due-date.description": "Your subscription will end on {{dueDate}}",
"com.affine.payment.billing-setting.resume-subscription": "Resume",
"com.affine.payment.billing-setting.subtitle": "Manage your billing information and invoices.",
"com.affine.payment.billing-setting.subtitle": "Manage your billing information and invoices",
"com.affine.payment.billing-setting.title": "Billing",
"com.affine.payment.billing-setting.update": "Update",
"com.affine.payment.billing-setting.upgrade": "Upgrade",
Expand Down Expand Up @@ -1241,7 +1241,7 @@
"com.affine.settings.editorSettings.preferences.export.title": "Export Settings",
"com.affine.settings.editorSettings.preferences.import.description": "You can import previously exported preferences data for restoration.",
"com.affine.settings.editorSettings.preferences.import.title": "Import Settings",
"com.affine.settings.editorSettings.subtitle": "Configure your own editor.",
"com.affine.settings.editorSettings.subtitle": "Configure your own editor",
"com.affine.settings.editorSettings.title": "Editor settings",
"com.affine.settings.email": "Email",
"com.affine.settings.email.action": "Change email",
Expand Down

0 comments on commit 7399e3f

Please sign in to comment.