Skip to content

Commit

Permalink
feat: close app if user selects NOT to fix data #3052
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Mar 1, 2024
1 parent 5f4e5ea commit 67a5758
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/core/data-repair/data-repair.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { TranslateService } from '@ngx-translate/core';
import { dataRepair } from './data-repair.util';
import { isDataRepairPossible } from './is-data-repair-possible.util';
import { getLastValidityError } from '../../imex/sync/is-valid-app-data.util';
import { IS_ELECTRON } from '../../app.constants';

@Injectable({
providedIn: 'root',
Expand All @@ -21,10 +22,17 @@ export class DataRepairService {
alert('Data damaged, repair not possible.');
return false;
}
return confirm(

const isConfirmed = confirm(
this._translateService.instant(T.CONFIRM.AUTO_FIX, {
validityError: getLastValidityError() || 'Unknown validity error',
}),
);

if (IS_ELECTRON && !isConfirmed) {
window.ea.shutdownNow();
}

return isConfirmed;
}
}

0 comments on commit 67a5758

Please sign in to comment.