MCPcopy Create free account
hub / github.com/ShouChenICU/FastSend / initializeFromStorage

Function initializeFromStorage

app/stores/user.ts:72–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

70 }
71
72 function initializeFromStorage() {
73 if (!import.meta.client || hasInitialized.value) {
74 return
75 }
76
77 const nickname = localStorage.getItem('nickname')
78 if (nickname) {
79 userInfo.nickname = nickname
80 } else {
81 setNickname('')
82 }
83
84 const avatarURL = localStorage.getItem('avatarURL')
85 if (avatarURL) {
86 userInfo.avatarURL = avatarURL
87 } else {
88 initAvatar()
89 }
90
91 isConfirmDefault.value = getValFromLocalStorage('isConfirmDefault', false) || false
92 hasInitialized.value = true
93 }
94
95 return {
96 userInfo,

Callers

nothing calls this directly

Calls 3

setNicknameFunction · 0.85
initAvatarFunction · 0.85
getValFromLocalStorageFunction · 0.85

Tested by

no test coverage detected