refactor(job): Force services to always reload after jobs execution

pull/133/head
NaiJi ✨ 2022-10-06 19:45:25 +00:00
parent d0be867aa6
commit 26466bb8d5
2 changed files with 1 additions and 9 deletions

View File

@ -23,8 +23,6 @@ class JobsCubit extends Cubit<JobsState> {
final UsersCubit usersCubit;
final ServicesCubit servicesCubit;
bool hasServiceJobs = false;
void addJob(final ClientJob job) {
final List<ClientJob> newJobsList = [];
if (state is JobsStateWithJobs) {
@ -112,12 +110,7 @@ class JobsCubit extends Cubit<JobsState> {
await api.pullConfigurationUpdate();
await api.apply();
if (hasServiceJobs) {
await servicesCubit.load();
}
hasServiceJobs = false;
await servicesCubit.load();
emit(JobsStateEmpty());
}

View File

@ -106,7 +106,6 @@ class ServiceToggleJob extends ToggleJob {
@override
void execute(final JobsCubit cubit) async {
cubit.hasServiceJobs = true;
await cubit.api.switchService(service.id, needToTurnOn);
}