@ -44,7 +44,6 @@ import {
} from '../../session/apis/snode_api/snodePool' ;
import { ConfigurationSync } from '../../session/utils/job_runners/jobs/ConfigurationSyncJob' ;
import { isDarkTheme } from '../../state/selectors/theme' ;
import { ensureThemeConsistency } from '../../themes/SessionTheme' ;
import { switchThemeTo } from '../../themes/switchTheme' ;
import { ReleasedFeatures } from '../../util/releaseFeature' ;
import { getOppositeTheme } from '../../util/theme' ;
@ -149,29 +148,6 @@ const cleanUpMediasInterval = DURATION.MINUTES * 60;
// * if there is a version on the fileserver more recent than our current, we fetch github to get the UpdateInfos and trigger an update as usual (asking user via dialog)
const fetchReleaseFromFileServerInterval = 1000 * 60 ; // try to fetch the latest release from the fileserver every minute
const setupTheme = async ( ) = > {
const shouldFollowSystemTheme = window . getSettingValue ( SettingsKey . hasFollowSystemThemeEnabled ) ;
const theme = window . Events . getThemeSetting ( ) ;
const themeConfig = {
theme ,
mainWindow : true ,
usePrimaryColor : true ,
dispatch : window?.inboxStore?.dispatch || undefined ,
} ;
if ( shouldFollowSystemTheme ) {
// Check if system theme matches currently set theme, if not switch it and return true, if matching return false
const wasThemeSwitched = await ensureThemeConsistency ( ) ;
if ( ! wasThemeSwitched ) {
// if theme wasn't switched them set theme to default
await switchThemeTo ( themeConfig ) ;
}
return ;
}
await switchThemeTo ( themeConfig ) ;
} ;
// Do this only if we created a new account id, or if we already received the initial configuration message
const triggerSyncIfNeeded = async ( ) = > {
const us = UserUtils . getOurPubKeyStrFromCache ( ) ;
@ -199,7 +175,6 @@ const triggerAvatarReUploadIfNeeded = async () => {
* This function is called only once : on app startup with a logged in user
* /
const doAppStartUp = async ( ) = > {
void setupTheme ( ) ;
// this generates the key to encrypt attachments locally
await Data . generateAttachmentKeyIfEmpty ( ) ;