mirror of
https://git.selfprivacy.org/kherel/selfprivacy.org.app.git
synced 2025-01-23 09:16:54 +00:00
refactor(job): Force services to always reload after jobs execution
This commit is contained in:
parent
d0be867aa6
commit
26466bb8d5
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue