mirror of
https://github.com/qier222/YesPlayMusic.git
synced 2024-12-03 05:53:37 +08:00
36 lines
856 B
TypeScript
36 lines
856 B
TypeScript
import { IpcChannels } from '@/shared/IpcChannels'
|
|
import { proxy } from 'valtio'
|
|
|
|
interface UIStates {
|
|
showLyricPanel: boolean
|
|
showLoginPanel: boolean
|
|
hideTopbarBackground: boolean
|
|
mobileShowPlayingNext: boolean
|
|
blurBackgroundImage: string | null
|
|
fullscreen: boolean
|
|
playingVideoID: number | null
|
|
isPauseVideos: boolean
|
|
}
|
|
|
|
const initUIStates: UIStates = {
|
|
showLyricPanel: false,
|
|
showLoginPanel: false,
|
|
hideTopbarBackground: false,
|
|
mobileShowPlayingNext: false,
|
|
blurBackgroundImage: null,
|
|
fullscreen: false,
|
|
playingVideoID: null,
|
|
isPauseVideos: false,
|
|
}
|
|
|
|
window.ipcRenderer
|
|
?.invoke(IpcChannels.IsMaximized)
|
|
.then(isMaximized => (initUIStates.fullscreen = !!isMaximized))
|
|
|
|
const uiStates = proxy<UIStates>(initUIStates)
|
|
export default uiStates
|
|
|
|
export const closeVideoPlayer = () => {
|
|
uiStates.playingVideoID = null
|
|
}
|