Fixes for PostHog
This commit is contained in:
@@ -21,6 +21,7 @@ class PermissionsProvider extends ChangeNotifier {
|
||||
Resource<UserAccess> _userAccess = Resource(data: null, isLoading: false, error: null);
|
||||
late OrganizationsProvider _organizations;
|
||||
bool _isLoaded = false;
|
||||
bool _errorHandled = false;
|
||||
|
||||
void update(OrganizationsProvider venue) {
|
||||
_organizations = venue;
|
||||
@@ -44,6 +45,7 @@ class PermissionsProvider extends ChangeNotifier {
|
||||
/// Load the [UserAccess] for the current venue.
|
||||
Future<UserAccess?> load() async {
|
||||
_userAccess = _userAccess.copyWith(isLoading: true, error: null);
|
||||
_errorHandled = false;
|
||||
notifyListeners();
|
||||
|
||||
try {
|
||||
@@ -67,6 +69,12 @@ class PermissionsProvider extends ChangeNotifier {
|
||||
return _userAccess.data;
|
||||
}
|
||||
|
||||
bool get hasUnhandledError => error != null && !_errorHandled;
|
||||
|
||||
void markErrorHandled() {
|
||||
_errorHandled = true;
|
||||
}
|
||||
|
||||
Future<UserAccess?> changeRole(String accountRef, String newRoleDescRef) async {
|
||||
final currentRole = roles.firstWhereOrNull((r) => r.accountRef == accountRef);
|
||||
final currentDesc = currentRole != null
|
||||
|
||||
Reference in New Issue
Block a user