diff --git a/src/renderer/components/MainPage.tsx b/src/renderer/components/MainPage.tsx index d607ff9dae9..2c666dcf0d0 100644 --- a/src/renderer/components/MainPage.tsx +++ b/src/renderer/components/MainPage.tsx @@ -54,7 +54,6 @@ type State = { mentionCounts: Record; maximized: boolean; tabViewStatus: Map; - darkMode: boolean; modalOpen?: boolean; fullScreen?: boolean; showExtraBar?: boolean; @@ -91,7 +90,6 @@ class MainPage extends React.PureComponent { mentionCounts: {}, maximized: false, tabViewStatus: new Map(), - darkMode: this.props.darkMode, isMenuOpen: false, isDownloadsDropdownOpen: false, showDownloadsBadge: false, @@ -194,10 +192,6 @@ class MainPage extends React.PureComponent { this.updateTabStatus(viewId, statusValue); }); - window.desktop.onDarkModeChange((darkMode) => { - this.setState({darkMode}); - }); - // can't switch tabs sequentially for some reason... window.desktop.onSetActiveView(this.setActiveView); @@ -407,7 +401,7 @@ class MainPage extends React.PureComponent { const tabsRow = ( { const topBarClassName = classNames('topBar', { macOS: window.process.platform === 'darwin', - darkMode: this.state.darkMode, + darkMode: this.props.darkMode, fullScreen: this.state.fullScreen, }); const downloadsDropdownButton = this.state.hasDownloads ? ( { totalMentionCount={totalMentionCount} hasUnreads={hasAnyUnreads} isMenuOpen={this.state.isMenuOpen} - darkMode={this.state.darkMode} + darkMode={this.props.darkMode} /> )} {tabsRow} @@ -589,7 +583,7 @@ class MainPage extends React.PureComponent { const viewsRow = ( { window.desktop.goBack();