mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
fix: bugs
This commit is contained in:
parent
ffdf66b57e
commit
d3e44541fb
17 changed files with 799 additions and 469 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { proxy, subscribe } from 'valtio'
|
||||
import { devtools } from 'valtio/utils'
|
||||
import { Player } from '@/renderer/utils/player'
|
||||
import {merge} from 'lodash-es'
|
||||
|
||||
interface Store {
|
||||
uiStates: {
|
||||
|
|
@ -26,7 +27,7 @@ const initialState: Store = {
|
|||
|
||||
const stateInLocalStorage = localStorage.getItem('state')
|
||||
export const state = proxy<Store>(
|
||||
(stateInLocalStorage && JSON.parse(stateInLocalStorage)) || initialState
|
||||
merge(initialState, stateInLocalStorage ? JSON.parse(stateInLocalStorage) : {})
|
||||
)
|
||||
subscribe(state, () => {
|
||||
localStorage.setItem('state', JSON.stringify(state))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue