Search code examples
angularjstwittertwitter-digits

Twitter Digits - Digits.init() can be called only once


I am using the Twitter Digits embeddable widget in a portal to allow users to enable Twitter Digits two factor authentication. The setup I have is exactly the same as the sample they provide: https://docs.fabric.io/web/digits/embeddable.html

The first time you hit the page where you have the twitter digits widget, everything works fine. However if from the menu you navigate to a different page and then get back to the twitter digits page I am getting the following error in the console and the iframe doesn't load.

Error: Digits.init() can be called only once

Can anyone tell me whether there is a way to clear/destroy the twitter instance and load a new one on the second try? I've had a look at their documentation but couldn't find something of the sort unfortunately.


Solution

  • Issue resolved. I am checking Digits.isInitialized() to check whether twitter digits is already initialized or not.