enable back ability to switch theme from leftpane

This commit is contained in:
Audric Ackermann 2020-08-21 12:54:29 +10:00
parent 103962f1eb
commit 39463d2f93
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
4 changed files with 11 additions and 8 deletions

View File

@ -368,7 +368,7 @@
// These make key operations available to IPC handlers created in preload.js
window.Events = {
getThemeSetting: () => 'dark', // storage.get('theme-setting', 'dark')
getThemeSetting: () => storage.get('theme-setting', 'dark'),
setThemeSetting: value => {
storage.put('theme-setting', value);
onChangeTheme();

View File

@ -25,7 +25,7 @@
},
applyTheme() {
const iOS = storage.get('userAgent') === 'OWI';
const theme = 'dark'; // storage.get('theme-setting') || 'dark';
const theme = storage.get('theme-setting') || 'dark';
this.$el
.removeClass('light-theme')
.removeClass('dark-theme')

View File

@ -166,7 +166,6 @@ $session-compose-margin: 20px;
&:last-child {
margin: auto auto 0px auto;
/* Hide theme icon until light theme is ready */
display: none;
}
&:first-child {

View File

@ -93,11 +93,15 @@ export class ActionsPanel extends React.Component<Props, State> {
}) => {
const handleClick = onSelect
? () => {
type === SectionType.Profile
? /* tslint:disable-next-line:no-void-expression */
this.editProfileHandle()
: /* tslint:disable-next-line:no-void-expression */
onSelect(type);
/* tslint:disable:no-void-expression */
if (type === SectionType.Profile) {
this.editProfileHandle()
} else if (type === SectionType.Moon) {
window.toggleTheme();
} else {
onSelect(type);
}
/* tslint:enable:no-void-expression */
}
: undefined;