Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc authored May 29, 2024
1 parent fad7e97 commit 0ebec3c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
5 changes: 5 additions & 0 deletions lib/dialog/edit_user_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ class _EditUserPage extends State<EditUserPage> {
listener.tryEmit("update_user", user);
} catch (e) {
_log.severe("Failed to update user ${widget.uid}: $e");
if (!_requestCancel!.isCancelled) {
setState(() {
_isRequesting = false;
});
}
}
}

Expand Down
27 changes: 17 additions & 10 deletions lib/dialog/new_user_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class _NewUserPage extends State<NewUserPage> {
listener.tryEmit("new_user", _newUserId);
} catch (e) {
_log.severe("Failed to create new user: $e");
if (!_cancel!.isCancelled) {
setState(() {
_isRequesting = false;
});
}
}
}

Expand Down Expand Up @@ -153,16 +158,18 @@ class _NewUserPage extends State<NewUserPage> {
},
obscureText: !_passwordVisible,
)),
_buildWithVecticalPadding(LabeledCheckbox(
value: _isAdmin,
onChanged: (b) {
if (b != null) {
setState(() {
_isAdmin = b;
});
}
},
label: Text(i18n.admin))),
auth.isRoot == true
? _buildWithVecticalPadding(LabeledCheckbox(
value: _isAdmin,
onChanged: (b) {
if (b != null) {
setState(() {
_isAdmin = b;
});
}
},
label: Text(i18n.admin)))
: Container(),
!_isAdmin
? _buildWithVecticalPadding(UserPermissionsChips(
permissions: _permissions,
Expand Down

0 comments on commit 0ebec3c

Please sign in to comment.