fix(settings): Make night mode settings-toggle actually work (#15817)
Closes #15790
This commit is contained in:
committed by
Quincy Larson
parent
61d740b8a0
commit
b76f3aaf54
@ -35,12 +35,13 @@ export default function nightModeSaga(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter(() => false);
|
.filter(() => false);
|
||||||
|
|
||||||
const toggle = actions
|
const toggle = actions
|
||||||
.filter(({ type }) => types.toggleNightMode === type);
|
.filter(({ type }) => types.toggleNightMode === type);
|
||||||
|
|
||||||
const optimistic = toggle
|
const optimistic = toggle
|
||||||
.flatMap(() => {
|
.flatMap(() => {
|
||||||
const { theme } = themeSelector(getState());
|
const theme = themeSelector(getState());
|
||||||
const newTheme = !theme || theme === 'default' ? 'night' : 'default';
|
const newTheme = !theme || theme === 'default' ? 'night' : 'default';
|
||||||
persistTheme(newTheme);
|
persistTheme(newTheme);
|
||||||
return Observable.of(
|
return Observable.of(
|
||||||
|
Reference in New Issue
Block a user