()
| 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, |
nothing calls this directly
no test coverage detected