🐛 Fix unauthorized things
This commit is contained in:
parent
306ce9e2b4
commit
aeaade9590
@ -216,6 +216,7 @@ class AuthProvider extends GetConnect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> refreshUserProfile() async {
|
Future<void> refreshUserProfile() async {
|
||||||
|
if (!isAuthorized.value) return;
|
||||||
final client = configureClient('auth');
|
final client = configureClient('auth');
|
||||||
final resp = await client.get('/users/me');
|
final resp = await client.get('/users/me');
|
||||||
if (resp.statusCode != 200) {
|
if (resp.statusCode != 200) {
|
||||||
|
@ -204,7 +204,8 @@ class _AppNavigationDrawerState extends State<AppNavigationDrawer>
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_getStatus();
|
final AuthProvider auth = Get.find();
|
||||||
|
if (auth.isAuthorized.value) _getStatus();
|
||||||
Future.delayed(Duration.zero, () => _autoResize());
|
Future.delayed(Duration.zero, () => _autoResize());
|
||||||
_drawerAnimationController.addListener(() {
|
_drawerAnimationController.addListener(() {
|
||||||
if (_drawerAnimation.value > 180 && _isCollapsed) {
|
if (_drawerAnimation.value > 180 && _isCollapsed) {
|
||||||
|
Loading…
Reference in New Issue
Block a user