import { settingsStore } from 'root/app/settings-store/settings_store' ; import { asMap , asString } from 'root/lib/type_utils' ; import { isMac } from 'root/lib/utils' ; function loadAppIconInternal ( type ) { if ( type === undefined ) { type = '' ; } if ( isMac ( ) ) { require ( `root/statics/mac/mac-icon${ type }@2x.png` ) ; require ( `root/statics/mac/mac-icon${ type }@3x.png` ) ; require ( `root/statics/mac/mac-icon${ type }@4x.png` ) ; require ( `root/statics/mac/mac-icon${ type }@5x.png` ) ; return require ( `root/statics/mac/mac-icon${ type }.png` ) ; } return require ( `root/statics/icon${ type }.ico` ) ; } export function loadAppIcon ( type ) { return asString ( asMap ( loadAppIconInternal ( type ) , { } ) . default , '' ) ; } let appIcon ; export function getAppIcon ( ) { if ( appIcon === undefined ) { appIcon = loadAppIcon ( settingsStore . get ( ) . icon ) ; } return appIcon ; }