Show that we are doing something when upgrading/restarting server

pull/83/head
Inex Code 2021-12-20 15:03:50 +00:00
parent 9594c538c7
commit 9b2fe905e6
1 changed files with 4 additions and 0 deletions

View File

@ -69,15 +69,18 @@ class JobsCubit extends Cubit<JobsState> {
} }
Future<void> rebootServer() async { Future<void> rebootServer() async {
emit(JobsStateLoading());
final isSuccessful = await api.reboot(); final isSuccessful = await api.reboot();
if (isSuccessful) { if (isSuccessful) {
getIt<NavigationService>().showSnackBar('jobs.rebootSuccess'.tr()); getIt<NavigationService>().showSnackBar('jobs.rebootSuccess'.tr());
} else { } else {
getIt<NavigationService>().showSnackBar('jobs.rebootFailed'.tr()); getIt<NavigationService>().showSnackBar('jobs.rebootFailed'.tr());
} }
emit(JobsStateEmpty());
} }
Future<void> upgradeServer() async { Future<void> upgradeServer() async {
emit(JobsStateLoading());
final isPullSuccessful = await api.pullConfigurationUpdate(); final isPullSuccessful = await api.pullConfigurationUpdate();
final isSuccessful = await api.upgrade(); final isSuccessful = await api.upgrade();
if (isSuccessful) { if (isSuccessful) {
@ -89,6 +92,7 @@ class JobsCubit extends Cubit<JobsState> {
} else { } else {
getIt<NavigationService>().showSnackBar('jobs.upgradeFailed'.tr()); getIt<NavigationService>().showSnackBar('jobs.upgradeFailed'.tr());
} }
emit(JobsStateEmpty());
} }
Future<void> applyAll() async { Future<void> applyAll() async {