trigger theme switch with user theme on app start

pull/1381/head
Audric Ackermann 4 years ago
parent d729e49840
commit 88cd58e7ff
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -72,8 +72,11 @@ type PropsHousekeeping = {
type Props = PropsData & PropsHousekeeping;
const Portal = ({ children }: { children: any }) => {
return createPortal(children, document.querySelector('.inbox.index') as Element);
}
return createPortal(
children,
document.querySelector('.inbox.index') as Element
);
};
class ConversationListItem extends React.PureComponent<Props> {
public constructor(props: Props) {

@ -37,6 +37,15 @@ class ActionsPanelPrivate extends React.Component<Props> {
void removeItemById('hasSeenLightModeDialog');
}
// fetch the user saved theme from the db, and apply it on mount.
public componentDidMount() {
const theme = window.Events.getThemeSetting();
window.setTheme(theme);
const newThemeObject = theme === 'dark' ? darkTheme : lightTheme;
this.props.applyTheme(newThemeObject);
}
public Section = ({
isSelected,
onSelect,

Loading…
Cancel
Save