Skip to content

Commit b434d4d

Browse files
committed
just formatting files, and cleaning up a weird detail: two calls on the same line in frontend/account/settings/password-setting.tsx
1 parent 4bd5ba3 commit b434d4d

File tree

5 files changed

+27
-20
lines changed

5 files changed

+27
-20
lines changed

src/packages/frontend/account/settings/email-address-setting.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export const EmailAddressSetting = ({
5151
async function save_editing(): Promise<void> {
5252
if (password.length < MIN_PASSWORD_LENGTH) {
5353
setState("edit");
54-
setError(`Password must be at least ${MIN_PASSWORD_LENGTH} characters long.`);
54+
setError(
55+
`Password must be at least ${MIN_PASSWORD_LENGTH} characters long.`,
56+
);
5557
return;
5658
}
5759
setState("saving");

src/packages/frontend/account/settings/password-setting.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export const PasswordSetting: React.FC = () => {
6868
if (!is_mounted.current) return;
6969
} catch (err) {
7070
if (!is_mounted.current) return;
71-
set_state("edit"), set_error(`Error changing password -- ${err}`);
71+
set_state("edit");
72+
set_error(`Error changing password -- ${err}`);
7273
return;
7374
}
7475
reset();
@@ -138,8 +139,10 @@ export const PasswordSetting: React.FC = () => {
138139
onChange={(e) => set_old_password(e.target.value)}
139140
/>
140141
</Form.Item>
141-
New password
142-
{new_password.length < MIN_PASSWORD_LENGTH ? ` (at least ${MIN_PASSWORD_LENGTH} characters)` : undefined}
142+
New password
143+
{new_password.length < MIN_PASSWORD_LENGTH
144+
? ` (at least ${MIN_PASSWORD_LENGTH} characters)`
145+
: undefined}
143146
{new_password.length >= 6 && new_password == old_password
144147
? " (different than old password)"
145148
: undefined}

src/packages/next/components/account/config/account/api.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,17 @@ register({
9696
style={{ maxWidth: "50ex" }}
9797
placeholder="Enter your password..."
9898
onChange={(e) => setPassword(e.target.value)}
99-
onPressEnter={() => {
100-
if (password.length >= MIN_PASSWORD_LENGTH) {
101-
submitPassword(password);
102-
}
103-
}}
99+
onPressEnter={() => {
100+
if (password.length >= MIN_PASSWORD_LENGTH) {
101+
submitPassword(password);
102+
}
103+
}}
104104
/>
105-
<Button
106-
style={{ marginLeft: "15px" }}
107-
disabled={password.length < MIN_PASSWORD_LENGTH}
108-
onClick={() => submitPassword(password)}
109-
>
105+
<Button
106+
style={{ marginLeft: "15px" }}
107+
disabled={password.length < MIN_PASSWORD_LENGTH}
108+
onClick={() => submitPassword(password)}
109+
>
110110
Show Older Legacy API Key
111111
</Button>
112112
</div>

src/packages/next/components/auth/in-place-sign-in-or-up.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55

66
// TODO: below we need to get the strategies!
77
// and also requiresToken for SignUp!
8-
9-
import { Divider } from "antd";
10-
import { useRouter } from "next/router";
11-
import { CSSProperties, ReactNode, useState } from "react";
12-
138
import { Icon } from "@cocalc/frontend/components/icon";
9+
import { Divider } from "antd";
1410
import SignInAuth from "components/auth/sign-in";
1511
import SignUpAuth from "components/auth/sign-up";
12+
import { useRouter } from "next/router";
13+
import { CSSProperties, ReactNode, useState } from "react";
1614

1715
import { AUTH_WRAPPER_STYLE } from "./shared";
1816

src/packages/next/pages/api/v2/auth/sign-up.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ import {
5656
} from "lib/api/schema/accounts/sign-up";
5757
import { SignUpIssues } from "lib/types/sign-up";
5858
import { getAccount, signUserIn } from "./sign-in";
59-
import { MAX_PASSWORD_LENGTH, MIN_PASSWORD_LENGTH, MIN_PASSWORD_STRENGTH } from "@cocalc/util/auth";
59+
import {
60+
MAX_PASSWORD_LENGTH,
61+
MIN_PASSWORD_LENGTH,
62+
MIN_PASSWORD_STRENGTH,
63+
} from "@cocalc/util/auth";
6064

6165
export async function signUp(req, res) {
6266
let {

0 commit comments

Comments
 (0)