GetScatter / scatter-js

Importable JavaScript library that allows web applications to directly interface with Scatter Desktop, Classic and Mobile.
MIT License
262 stars 148 forks source link

a way to identify when user login to Scatter #34

Closed or2008 closed 5 years ago

or2008 commented 6 years ago

Hello, I am building an Eos Dapp using Scatter, and when the app is loaded I check if the user is connected using this line:

const isConnected = await ScatterJS.scatter.connect('My App');

if the user is not connected, I show him a message that tells him to connect.

is there a way to auto detect when the user login? I tried running the above code in interval to check for updates, but it doesn't work so good.

nsjames commented 5 years ago

connect doesn't log the user in. Here, see this boilerplate. https://github.com/GetScatter/Boilerplates/blob/master/scatterjs-plugin-eosjs/src/views/Home.vue#L139