v0.10.3 ui changes and bug fixes
This commit is contained in:
@@ -222,12 +222,17 @@ export default function UserManagerModal({ onClose }) {
|
||||
const [userPass, setUserPass] = useState('user@1234');
|
||||
|
||||
const [loadError, setLoadError] = useState('');
|
||||
const load = () => {
|
||||
const load = async () => {
|
||||
setLoadError('');
|
||||
api.getUsers()
|
||||
.then(({ users }) => setUsers(users))
|
||||
.catch(e => setLoadError(e.message || 'Failed to load users'))
|
||||
.finally(() => setLoading(false));
|
||||
setLoading(true);
|
||||
try {
|
||||
const { users } = await api.getUsers();
|
||||
setUsers(users || []);
|
||||
} catch (e) {
|
||||
setLoadError(e.message || 'Failed to load users');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
useEffect(() => {
|
||||
load();
|
||||
|
||||
Reference in New Issue
Block a user