mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
feat: updates
This commit is contained in:
parent
0b4baa3eff
commit
222fb02355
77 changed files with 654 additions and 551 deletions
19
packages/web/states/persistedUiStates.ts
Normal file
19
packages/web/states/persistedUiStates.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { proxy, subscribe } from 'valtio'
|
||||
|
||||
interface PersistedUiStates {
|
||||
loginPhoneCountryCode: string
|
||||
loginType: 'phone' | 'email' | 'qrCode'
|
||||
}
|
||||
|
||||
const initPersistedUiStates: PersistedUiStates = {
|
||||
loginPhoneCountryCode: '+86',
|
||||
loginType: 'qrCode',
|
||||
}
|
||||
|
||||
const persistedUiStates = proxy<PersistedUiStates>(initPersistedUiStates)
|
||||
|
||||
subscribe(persistedUiStates, () => {
|
||||
localStorage.setItem('persistedUiStates', JSON.stringify(persistedUiStates))
|
||||
})
|
||||
|
||||
export default persistedUiStates
|
||||
Loading…
Add table
Add a link
Reference in a new issue