Show that we are doing something when upgrading/restarting server

remotes/1708434123922220183/feature/service-configurations
Inex Code 2021-12-20 15:03:50 +00:00 committed by kherel
parent 532a3ab197
commit e72df08453
1 changed files with 4 additions and 0 deletions

View File

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