Skip to content

Commit

Permalink
Merge pull request #55 from spknetwork/bug/add-multiple-accounts
Browse files Browse the repository at this point in the history
Bug/add multiple accounts
  • Loading branch information
igormuba committed Aug 11, 2023
2 parents d6aaf79 + acdd8dc commit 93ed71f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/renderer/views/Accounts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function AccountsView() {

localStorage.setItem('SNProfileID', profileID)
setLogin(theAcc.nickname)
window.location.reload()
}

const logOut = async (profileID: string) => {
Expand Down
22 changes: 11 additions & 11 deletions src/renderer/views/LoginView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ export function LoginView() {
setUsername('')
setKey('')
}
useEffect(() => {
const load = async () => {
const login = localStorage.getItem('SNProfileID')
const accountsInit = (await AccountService.getAccounts()) as any[]
if (login && accountsInit.length > 0) {
history.push('/')
}
}

void load()
}, [])
// useEffect(() => {
// const load = async () => {
// const login = localStorage.getItem('SNProfileID')
// const accountsInit = (await AccountService.getAccounts()) as any[]
// if (login && accountsInit.length > 0) {
// history.push('/')
// }
// }

// void load()
// }, [])

const onUsernameChange = useCallback(async (event) => {
console.log(`username change ${event.target.value}`)
Expand Down

0 comments on commit 93ed71f

Please sign in to comment.