onSaveSubject()} onCancel={() => setShowEdit(false)}>
diff --git a/net/web/src/User/SideBar/Contacts/Channels/AddChannel/AddChannel.jsx b/net/web/src/User/SideBar/Contacts/Channels/AddChannel/AddChannel.jsx
index 28176e9e..c61fbc50 100644
--- a/net/web/src/User/SideBar/Contacts/Channels/AddChannel/AddChannel.jsx
+++ b/net/web/src/User/SideBar/Contacts/Channels/AddChannel/AddChannel.jsx
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react'
-import { Button, Select, Modal, Collapse, Input } from 'antd';
+import { Space, Button, Select, Modal, Collapse, Input } from 'antd';
import { SelectItem, ConversationWrapper, Description, BusySpin } from './AddChannel.styled';
import { Logo } from '../../../../../Logo/Logo';
@@ -18,22 +18,19 @@ export function AddChannel({ state, actions }) {
return (
-
)
diff --git a/net/web/src/User/SideBar/Identity/Identity.jsx b/net/web/src/User/SideBar/Identity/Identity.jsx
index b79aa4fc..54ac44fa 100644
--- a/net/web/src/User/SideBar/Identity/Identity.jsx
+++ b/net/web/src/User/SideBar/Identity/Identity.jsx
@@ -1,4 +1,4 @@
-import { Avatar, Space, Image, Modal, Form, Input } from 'antd';
+import { Avatar, Space, Image, Modal, Form, Input, Button } from 'antd';
import React, { useState } from 'react'
import { IdentityWrapper, IdentityDropdown, MenuWrapper } from './Identity.styled';
import { RightOutlined, EditOutlined, UserOutlined, LockOutlined } from '@ant-design/icons';
@@ -8,7 +8,6 @@ import { Logo } from '../../../Logo/Logo';
export function Identity() {
- const [ showLogin, setShowLogin ] = useState(false);
const { state, actions } = useIdentity()
const menu = (
@@ -17,7 +16,7 @@ export function Identity() {
actions.editProfile()}>Edit Profile
- setShowLogin(true)}>Change Login
+ actions.setShowLogin(true)}>Change Login
actions.logout()}>Sign Out
@@ -25,11 +24,6 @@ export function Identity() {
);
- const onChangeLogin = () => {
- let saved = actions.setLogin();
- setShowLogin(false);
- };
-
return (
@@ -44,8 +38,12 @@ export function Identity() {
- onChangeLogin()} onCancel={() => setShowLogin(false)}>
+ actions.setShowLogin(false)} loading={state.busy}
+ footer={[
+ ,
+
+ ]}>
}
diff --git a/net/web/src/User/SideBar/Identity/useIdentity.hook.js b/net/web/src/User/SideBar/Identity/useIdentity.hook.js
index ba90d695..52b5a462 100644
--- a/net/web/src/User/SideBar/Identity/useIdentity.hook.js
+++ b/net/web/src/User/SideBar/Identity/useIdentity.hook.js
@@ -20,7 +20,8 @@ export function useIdentity() {
passwordStatus: null,
confirm: null,
confirmStatus: null,
-
+ busy: false,
+ showLogin: false,
});
const navigate = useNavigate();
@@ -69,6 +70,9 @@ export function useIdentity() {
setConfirm: (value) => {
updateState({ confirm: value });
},
+ setShowLogin: (value) => {
+ updateState({ showLogin: value });
+ },
setLogin: async () => {
if (state.username == null || state.username == '') {
updateState({ usernameStatus: 'username required' });
@@ -91,7 +95,17 @@ export function useIdentity() {
else {
updateState({ confirmStatus: null });
}
- await account.actions.setLogin(state.username, state.password);
+ if (!state.busy) {
+ updateState({ busy: true });
+ try {
+ await account.actions.setLogin(state.username, state.password);
+ updateState({ showLogin: false });
+ }
+ catch (err) {
+ window.alert(err);
+ }
+ updateState({ busy: false });
+ }
},
};