mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-03-11 09:14:10 +00:00
Show that we are doing something when upgrading/restarting server
This commit is contained in:
parent
9594c538c7
commit
9b2fe905e6
1 changed files with 4 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue