forked from SelfPrivacy/selfprivacy.org.app
Show that we are doing something when upgrading/restarting server
parent
9594c538c7
commit
9b2fe905e6
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue