mirror of
https://github.com/zoriya/Aeris.git
synced 2026-08-16 02:45:10 +00:00
Mobile Client: fix state
This commit is contained in:
@@ -68,8 +68,6 @@ class AerisAPI {
|
||||
http.Response response = await _requestAPI(
|
||||
'/auth/${service.name.toLowerCase()}/signin?code=$code',
|
||||
AerisAPIRequestType.post, {});
|
||||
print(response.body);
|
||||
print(response.statusCode);
|
||||
if (!response.ok) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ class AuthorizationPage extends StatelessWidget {
|
||||
|
||||
if (segments.removeLast() == 'signin') {
|
||||
GetIt.I<AerisAPI>().createConnectionFromService(service, code).then((value) => Navigator.pop(context));
|
||||
} else {
|
||||
Provider.of<ServiceProvider>(context, listen: false).addService(service, code).then((_) {
|
||||
Provider.of<ServiceProvider>(context, listen: false).notifyListeners();
|
||||
Navigator.pop(context);
|
||||
});
|
||||
}
|
||||
return Container();
|
||||
}
|
||||
Provider.of<ServiceProvider>(context, listen: false).addService(service, code).then((_) {
|
||||
Provider.of<ServiceProvider>(context, listen: false).notifyListeners();
|
||||
Navigator.pop(context);
|
||||
});
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
child: LoadingIndicator(
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:aeris/src/aeris_api.dart';
|
||||
import 'package:aeris/main.dart';
|
||||
import 'package:aeris/src/models/service.dart';
|
||||
|
||||
@@ -48,9 +48,8 @@ class _SetupActionPageState extends State<SetupActionPage> {
|
||||
super.initState();
|
||||
var services = Provider.of<ServiceProvider>(context, listen: false).connectedServices;
|
||||
if (services.isNotEmpty) {
|
||||
widget.action.service = services.contains(widget.action.service) ? widget.action.service : services[0];
|
||||
serviceState = widget.action.service;
|
||||
availableActions = GetIt.I<AerisAPI>().getActionsFor(services.contains(serviceState) ? serviceState : services[0], widget.action);
|
||||
serviceState = services.contains(widget.action.service) ? widget.action.service : services[0];
|
||||
availableActions = GetIt.I<AerisAPI>().getActionsFor(serviceState, widget.action);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user