Skip to content

Commit

Permalink
Add a retry
Browse files Browse the repository at this point in the history
  • Loading branch information
dkapila committed Jan 15, 2021
1 parent 8e93b7a commit 1f851d6
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 301 deletions.
16 changes: 13 additions & 3 deletions dist/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,21 @@ var twitterEmbedComponent = function twitterEmbedComponent(me) {
params = this.id;
}

Promise.resolve(window.twttr ? window.twttr : addPlatformScript('//platform.twitter.com/widgets.js')).then(function (twttr) {
var twitter_widgets_url = '//platform.twitter.com/widgets.js';
Promise.resolve(window.twttr ? window.twttr : addPlatformScript(twitter_widgets_url)).then(function (twttr) {
return me.embedComponent(twttr, params, _this.$el, _this.options);
}).then(function (data) {
_this.isAvailable = data !== undefined;
_this.isLoaded = true;
if (!data) {
Promise.resolve(window.twttr ? window.twttr : addPlatformScript(twitter_widgets_url)).then(function (twttr) {
return me.embedComponent(twttr, params, _this.$el, _this.options);
}).then(function (data) {
_this.isAvailable = data !== undefined;
_this.isLoaded = true;
});
} else {
_this.isAvailable = data !== undefined;
_this.isLoaded = true;
}
});
},
render: function render(h) {
Expand Down
2 changes: 1 addition & 1 deletion examples/moment/index.build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/tweet/index.build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1f851d6

Please sign in to comment.