Skip to content

Commit

Permalink
UiSettingState: Fix imeIncognito did not restored on initial state
Browse files Browse the repository at this point in the history
Fixes: #43
  • Loading branch information
nullxception committed Dec 10, 2022
1 parent 08ab6d8 commit 2401f26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/presentation/provider/settings/ui_setting_state.dart
Expand Up @@ -22,6 +22,7 @@ class UiSettingState extends _$UiSettingState {
themeMode: ThemeMode
.values[_repo.get(Setting.uiThemeMode, or: ThemeMode.system.index)],
midnightMode: _repo.get(Setting.uiMidnightMode, or: false),
imeIncognito: _repo.get(Setting.imeIncognito, or: false),
);
}

Expand Down Expand Up @@ -83,7 +84,7 @@ class UiSettingState extends _$UiSettingState {
return state.midnightMode;
}

Future<bool> setimeIncognito(bool value) async {
Future<bool> setImeIncognito(bool value) async {
state = state.copyWith(imeIncognito: value);
await _repo.put(Setting.imeIncognito, value);
return state.imeIncognito;
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/screens/settings/settings_page.dart
Expand Up @@ -230,7 +230,7 @@ class _ImeIncognito extends ConsumerWidget {
),
value: ref.watch(uiSettingStateProvider.select((ui) => ui.imeIncognito)),
onChanged: (value) {
ref.read(uiSettingStateProvider.notifier).setimeIncognito(value);
ref.read(uiSettingStateProvider.notifier).setImeIncognito(value);
},
);
}
Expand Down

0 comments on commit 2401f26

Please sign in to comment.