Skip to content

Commit

Permalink
#1193 - pushing the reset actions to background can cause the backgro…
Browse files Browse the repository at this point in the history
…und activity to be performed at a later time (depending on the scheduler). removing this possibility to ensure no errors are caused due to Action's initial state getting called after load.

Rmeoved some unnecessary, unused code.
  • Loading branch information
petmongrels committed Dec 4, 2023
1 parent e97ece2 commit d96007d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions packages/openchs-android/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import EntityService from "../../service/EntityService";
import {Family} from 'avni-models';
import _ from 'lodash';

class FamilyDashboardActions {

static cloneEntity(entity) {
if (!_.isNil(entity))
return entity.cloneForEdit();
}

static getInitialState() {
return {};
}
Expand Down Expand Up @@ -46,4 +39,4 @@ export {
FamilyDashboardActionsNames,
FamilyDashboardActionsMap,
FamilyDashboardActions,
};
};
3 changes: 1 addition & 2 deletions packages/openchs-android/src/service/SyncService.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,15 +360,14 @@ class SyncService extends BaseService {
resetServicesAfterFullSyncCompletion(updatedSyncSource) {
if (updatedSyncSource !== SyncService.syncSources.ONLY_UPLOAD_BACKGROUND_JOB) {
General.logInfo("Sync", "Full Sync completed, performing reset")
setTimeout(() => this.reset(false), 1);
this.reset(false);
this.getService(SettingsService).initLanguages();
General.logInfo("Sync", 'Full Sync completed, reset completed');
}
}

reset(syncRequired: false) {
this.context.getService(RuleEvaluationService).init();
this.context.getService(ProgramConfigService).init();
this.context.getService(MessageService).init();
this.context.getService(RuleService).init();
this.dispatchAction('RESET');
Expand Down

0 comments on commit d96007d

Please sign in to comment.