|
window.addEventListener('message', receiveMessage, { |
|
once: true, |
|
}); |
Because I am running Vue dev-tools, and it is sending messages for hot reload, I was confused. Sometimes I receive the token and most of the time I was not.
After debugging I've found adding once was not a good idea, instead I removeEventListener after receiving the token.
entropychat.app/client/src/store/modules/auth.js
Lines 43 to 45 in c76399c
Because I am running Vue dev-tools, and it is sending messages for hot reload, I was confused. Sometimes I receive the token and most of the time I was not.
After debugging I've found adding
oncewas not a good idea, instead IremoveEventListenerafter receiving the token.