2022-08-03 23:48:39 +08:00
|
|
|
import { IpcChannels } from '@/shared/IpcChannels'
|
2022-07-11 11:06:41 +08:00
|
|
|
import { proxy } from 'valtio'
|
|
|
|
|
|
|
|
interface UIStates {
|
|
|
|
showLyricPanel: boolean
|
|
|
|
showLoginPanel: boolean
|
|
|
|
hideTopbarBackground: boolean
|
|
|
|
librarySelectedTab: 'playlists' | 'albums' | 'artists' | 'videos'
|
|
|
|
mobileShowPlayingNext: boolean
|
2022-08-03 23:48:39 +08:00
|
|
|
blurBackgroundImage: string | null
|
|
|
|
fullscreen: boolean
|
2022-07-11 11:06:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const initUIStates: UIStates = {
|
|
|
|
showLyricPanel: false,
|
|
|
|
showLoginPanel: false,
|
|
|
|
hideTopbarBackground: false,
|
|
|
|
librarySelectedTab: 'playlists',
|
|
|
|
mobileShowPlayingNext: false,
|
2022-08-03 23:48:39 +08:00
|
|
|
blurBackgroundImage: null,
|
|
|
|
fullscreen: window.ipcRenderer?.sendSync(IpcChannels.IsMaximized) || false,
|
2022-07-11 11:06:41 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default proxy<UIStates>(initUIStates)
|