conflicts resolution
This commit is contained in:
@@ -26,13 +26,10 @@ class AccountLoader extends StatelessWidget {
|
||||
);
|
||||
navigateAndReplace(context, Pages.login);
|
||||
}
|
||||
if ((provider.error == null) && (provider.account == null)) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
provider.restore();
|
||||
});
|
||||
if (provider.account == null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => navigateAndReplace(context, Pages.login));
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
return child;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:pshared/provider/account.dart';
|
||||
import 'package:pshared/provider/permissions.dart';
|
||||
|
||||
import 'package:pweb/app/router/pages.dart';
|
||||
@@ -16,8 +17,10 @@ class PermissionsLoader extends StatelessWidget {
|
||||
const PermissionsLoader({super.key, required this.child});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Consumer<PermissionsProvider>(builder: (context, provider, _) {
|
||||
if (provider.isLoading) return const Center(child: CircularProgressIndicator());
|
||||
Widget build(BuildContext context) => Consumer2<PermissionsProvider, AccountProvider>(builder: (context, provider, accountProvider, _) {
|
||||
if (provider.isLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
if (provider.error != null) {
|
||||
postNotifyUserOfErrorX(
|
||||
context: context,
|
||||
@@ -26,7 +29,7 @@ class PermissionsLoader extends StatelessWidget {
|
||||
);
|
||||
navigateAndReplace(context, Pages.login);
|
||||
}
|
||||
if ((provider.error == null) && (provider.permissions.isEmpty)) {
|
||||
if (provider.error == null && !provider.isReady && accountProvider.account != null) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
provider.load();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user