Skip to content

Commit

Permalink
🥅 Guard signLogin returns null
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Feb 14, 2025
1 parent b117c7e commit 460b9b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/store/modules/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ const actions = {
if (getters.getAddress) {
// Re-login if the wallet address is different from session
const res = await dispatch('signLogin');
return { isNew: res.isNew };
return { isNew: res?.isNew };
}
} catch (err) {
const msg = (err.response && err.response.data) || err;
Expand Down Expand Up @@ -874,7 +874,7 @@ const actions = {
},
async signLogin({ state, commit, dispatch, getters }) {
// Do not trigger login if the window is not focused
if (document.hidden) return null;
if (state.methodType !== 'liker-id' && document.hidden) return null;
if (!state.signer) {
await dispatch('initIfNecessary');
}
Expand Down

0 comments on commit 460b9b9

Please sign in to comment.