Skip to content

Commit 83a328a

Browse files
authored
fix: persist settings (#707)
The 0b11011111110100 in Switch.java was changed in one of the previous commits. This somehow causes the Event Name to be null for ToggleMenuModel's, which breaks persisting the changes.
1 parent 2c09d52 commit 83a328a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

mod/app/src/main/java/bttv/settings/SettingsPresenter.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,9 @@ public void bindSettings() {
7575
MenuAdapterBinder binder = getAdapterBinder();
7676
binder.getAdapter().removeAllSections();
7777

78-
MenuSection menuSection = new MenuSection(getSettingModels(), null, null, 0b110, null);
7978
HeaderConfig headerCfg = new HeaderConfig(SectionHeaderDisplayConfig.IF_CONTENT,
8079
"Fine tune your BTTV experience", null, 0, 0, null, null, false, null, null, 0b1111111100, null);
81-
menuSection.updateHeaderConfig(headerCfg);
80+
MenuSection menuSection = new MenuSection(getSettingModels(), null, headerCfg, 0b110, null);
8281
binder.bindModels(getSettingModels(), getMSettingActionListener(), menuSection, null);
8382
}
8483

@@ -114,6 +113,10 @@ static class SettingsPreferencesControllerImpl implements SettingsPreferencesCon
114113
@Override
115114
public void updatePreferenceBooleanState(ToggleMenuModel toggleMenuModel, boolean z) {
116115
String key = toggleMenuModel.getEventName();
116+
if(key == null) {
117+
Log.w("LBTTVSettingsPC", "updatePreferenceBooleanState() key is null");
118+
return;
119+
}
117120
Settings setting = Settings.get(key);
118121

119122
if (setting == null) {

mod/app/src/main/java/bttv/settings/abstractions/Switch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static ToggleMenuModel simple (Context ctx, String primaryText, String se
2424
SettingsPreferencesController.SettingsPreference.BTTVEmotesEnabled,
2525
null,
2626
null,
27-
0b11011111110100,
27+
0b1011110110100,
2828
null
2929
);
3030
}

0 commit comments

Comments
 (0)