Disable persistence
This commit is contained in:
parent
6a96b602de
commit
0cabae784d
|
|
@ -385,7 +385,7 @@ Middleware<AppState> _createUserLoggedIn(
|
||||||
uiRepository.saveUIState(state.uiState);
|
uiRepository.saveUIState(state.uiState);
|
||||||
staticRepository.saveStaticState(state.staticState);
|
staticRepository.saveStaticState(state.staticState);
|
||||||
|
|
||||||
if (state.prefState.persistData || state.company.isSmall) {
|
if (state.prefState.persistData) {
|
||||||
for (var i = 0; i < state.userCompanyStates.length; i++) {
|
for (var i = 0; i < state.userCompanyStates.length; i++) {
|
||||||
companyRepositories[i].saveCompanyState(state.userCompanyStates[i]);
|
companyRepositories[i].saveCompanyState(state.userCompanyStates[i]);
|
||||||
}
|
}
|
||||||
|
|
@ -405,7 +405,7 @@ Middleware<AppState> _createPersistData(
|
||||||
final index = state.uiState.selectedCompanyIndex;
|
final index = state.uiState.selectedCompanyIndex;
|
||||||
final companyState = state.userCompanyStates[index];
|
final companyState = state.userCompanyStates[index];
|
||||||
|
|
||||||
if (state.prefState.persistData || state.company.isSmall) {
|
if (state.prefState.persistData) {
|
||||||
companyRepositories[index].saveCompanyState(companyState);
|
companyRepositories[index].saveCompanyState(companyState);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -216,17 +216,18 @@ class _DeviceSettingsState extends State<DeviceSettings>
|
||||||
activeColor: Theme.of(context).accentColor,
|
activeColor: Theme.of(context).accentColor,
|
||||||
),
|
),
|
||||||
*/
|
*/
|
||||||
if (state.company.isLarge || !kReleaseMode)
|
SwitchListTile(
|
||||||
SwitchListTile(
|
//leading: Icon(Icons.save_alt),
|
||||||
//leading: Icon(Icons.save_alt),
|
title: Text(localization.persistData),
|
||||||
title: Text(localization.persistData),
|
subtitle: Text(prefState.persistData
|
||||||
subtitle: Text(localization.persistDataHelp),
|
? localization.disablingMayImprovePerformance
|
||||||
value: prefState.persistData,
|
: localization.enablingMayDegradePerformance),
|
||||||
onChanged: (value) =>
|
value: prefState.persistData,
|
||||||
viewModel.onPersistDataChanged(context, value),
|
onChanged: (value) =>
|
||||||
activeColor: Theme.of(context).accentColor,
|
viewModel.onPersistDataChanged(context, value),
|
||||||
secondary: Icon(Icons.save_alt),
|
activeColor: Theme.of(context).accentColor,
|
||||||
),
|
secondary: Icon(Icons.save_alt),
|
||||||
|
),
|
||||||
Builder(builder: (BuildContext context) {
|
Builder(builder: (BuildContext context) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: Icon(Icons.refresh),
|
leading: Icon(Icons.refresh),
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
static final Map<String, Map<String, String>> _localizedValues = {
|
static final Map<String, Map<String, String>> _localizedValues = {
|
||||||
'en': {
|
'en': {
|
||||||
// STARTER: lang key - do not remove comment
|
// STARTER: lang key - do not remove comment
|
||||||
|
'enabling_may_degrade_performance': 'Enabling may degrade performance',
|
||||||
|
'disabling_may_improve_performance': 'Disabling may improve performance',
|
||||||
'clone_to_expense': 'Clone to Expense',
|
'clone_to_expense': 'Clone to Expense',
|
||||||
'recurring_expense': 'Recurring Expense',
|
'recurring_expense': 'Recurring Expense',
|
||||||
'recurring_expenses': 'Recurring Expenses',
|
'recurring_expenses': 'Recurring Expenses',
|
||||||
|
|
@ -34,7 +36,6 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
'is_invoiced': 'Is Invoiced',
|
'is_invoiced': 'Is Invoiced',
|
||||||
'change_plan': 'Change Plan',
|
'change_plan': 'Change Plan',
|
||||||
'persist_data': 'Persist Data',
|
'persist_data': 'Persist Data',
|
||||||
'persist_data_help': 'Enabling may degrade performance in large accounts',
|
|
||||||
'customer_count': 'Customer Count',
|
'customer_count': 'Customer Count',
|
||||||
'verify_customers': 'Verify Customers',
|
'verify_customers': 'Verify Customers',
|
||||||
'google_analytics_tracking_id': 'Google Analytics Tracking ID',
|
'google_analytics_tracking_id': 'Google Analytics Tracking ID',
|
||||||
|
|
@ -62529,10 +62530,6 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
_localizedValues[localeCode]['persist_data'] ??
|
_localizedValues[localeCode]['persist_data'] ??
|
||||||
_localizedValues['en']['persist_data'];
|
_localizedValues['en']['persist_data'];
|
||||||
|
|
||||||
String get persistDataHelp =>
|
|
||||||
_localizedValues[localeCode]['persist_data_help'] ??
|
|
||||||
_localizedValues['en']['persist_data_help'];
|
|
||||||
|
|
||||||
String get changePlan =>
|
String get changePlan =>
|
||||||
_localizedValues[localeCode]['change_plan'] ??
|
_localizedValues[localeCode]['change_plan'] ??
|
||||||
_localizedValues['en']['change_plan'];
|
_localizedValues['en']['change_plan'];
|
||||||
|
|
@ -62593,6 +62590,14 @@ mixin LocalizationsProvider on LocaleCodeAware {
|
||||||
_localizedValues[localeCode]['clone_to_expense'] ??
|
_localizedValues[localeCode]['clone_to_expense'] ??
|
||||||
_localizedValues['en']['clone_to_expense'];
|
_localizedValues['en']['clone_to_expense'];
|
||||||
|
|
||||||
|
String get enablingMayDegradePerformance =>
|
||||||
|
_localizedValues[localeCode]['enabling_may_degrade_performance'] ??
|
||||||
|
_localizedValues['en']['enabling_may_degrade_performance'];
|
||||||
|
|
||||||
|
String get disablingMayImprovePerformance =>
|
||||||
|
_localizedValues[localeCode]['disabling_may_improve_performance'] ??
|
||||||
|
_localizedValues['en']['disabling_may_improve_performance'];
|
||||||
|
|
||||||
// STARTER: lang field - do not remove comment
|
// STARTER: lang field - do not remove comment
|
||||||
|
|
||||||
String lookup(String key) {
|
String lookup(String key) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue