0

I am working on developing a web app in EOS. I am using scatter browser extension to sign the transactions. During page load, the status of scatter is checked using the following code

const setStatus = () => {
        const status = document.getElementById('status');

        if(!scatter) {
            status.innerText = 'Please install scatter';
        }

        else if(!scatter.identity) {
            status.innerText = 'No identity selected';
        }

        else{
            status.innerText = scatter.identity.name;
        }
    };

But during the page load, the scatter is not detected and (!scatter) condition is satisfied even if my scatter is all set. Is there any solution to detect scatter on page load instantly?

0

From the ScatterJs GitHub-Repository:

Connect to an available wallet

Once you are connected you can then call API methods on ScatterJS

ScatterJS.connect('MyAppName', {network}).then(connected => {
    if(!connected) return false;
    // ScatterJS.someMethod();
});

You can see full scatterjs-core API docs here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.