YesPlayMusic/packages/web/states/uiStates.ts
2022-10-28 20:29:04 +08:00

29 lines
752 B
TypeScript

import { IpcChannels } from '@/shared/IpcChannels'
import { proxy } from 'valtio'
interface UIStates {
showLyricPanel: boolean
showLoginPanel: boolean
hideTopbarBackground: boolean
librarySelectedTab: 'playlists' | 'albums' | 'artists' | 'videos'
mobileShowPlayingNext: boolean
blurBackgroundImage: string | null
fullscreen: boolean
}
const initUIStates: UIStates = {
showLyricPanel: false,
showLoginPanel: false,
hideTopbarBackground: false,
librarySelectedTab: 'playlists',
mobileShowPlayingNext: false,
blurBackgroundImage: null,
fullscreen: false,
}
window.ipcRenderer
?.invoke(IpcChannels.IsMaximized)
.then(isMaximized => (initUIStates.fullscreen = !!isMaximized))
export default proxy<UIStates>(initUIStates)