Skip to content

Commit

Permalink
fixed twitter widget, missed addition of the required error param
Browse files Browse the repository at this point in the history
  • Loading branch information
liamgold committed Aug 30, 2018
1 parent 10c89ec commit cd8b5cc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Models/Tweet.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export class Tweet extends ContentItem {
let tweetLink = tweet.tweetLink.value;
let tweetID = tweetLink.match("^.*twitter.com/.*/(\\d+)/?.*$")[1];

TwitterWidgetsLoader.load(twitter => {
TwitterWidgetsLoader.load((err, twitter) => {
if (err) {
return `<a href="${tweetLink}">${tweetLink}</a>`;
}

let selectedTheme = tweet.theme.value.pop().codename;
selectedTheme = selectedTheme ? selectedTheme : 'light';
twitter.widgets.createTweet(
Expand Down

0 comments on commit cd8b5cc

Please sign in to comment.