Skip to content

Commit

Permalink
Fix for missing donate buttons (#827)
Browse files Browse the repository at this point in the history
  • Loading branch information
deanoemcke committed Dec 19, 2018
1 parent c7a196f commit f4f87af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/js/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
gsAnalytics.reportEvent('Donations', 'HidePopupManual', hideNag);
}

function loadDonateButtons() {
document.getElementById('donateButtons').innerHTML = this.responseText;
function loadDonateButtons(responseText) {
document.getElementById('donateButtons').innerHTML = responseText;

var bitcoinBtn = document.getElementById('bitcoinBtn');
var patreonBtn = document.getElementById('patreonBtn');
Expand Down Expand Up @@ -55,7 +55,7 @@
}

var request = new XMLHttpRequest();
request.onload = loadDonateButtons;
request.onload = () => loadDonateButtons(request.responseText);
request.open('GET', 'support.html', true);
request.send();

Expand Down
11 changes: 7 additions & 4 deletions src/js/gsSuspendedTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ var gsSuspendedTab = (function() {

async function initTab(tab, tabView) {
if (!tabView) {
gsUtils.warning(tab.id, 'Could not get internalTabView for suspended tab');
gsUtils.warning(
tab.id,
'Could not get internalTabView for suspended tab'
);
}

gsUtils.localiseHtml(tabView.document);
Expand Down Expand Up @@ -404,7 +407,7 @@ var gsSuspendedTab = (function() {

const request = new XMLHttpRequest();
request.onload = () => {
loadDonateButtonsHtml(_document);
loadDonateButtonsHtml(_document, request.responseText);
};
request.open('GET', 'support.html', true);
request.send();
Expand All @@ -413,8 +416,8 @@ var gsSuspendedTab = (function() {
_document.getElementById('donateBubble').classList.add('fadeIn');
}

function loadDonateButtonsHtml(_document) {
_document.getElementById('donateButtons').innerHTML = this.responseText;
function loadDonateButtonsHtml(_document, responseText) {
_document.getElementById('donateButtons').innerHTML = responseText;
_document.getElementById('bitcoinBtn').innerHTML = chrome.i18n.getMessage(
'js_donate_bitcoin'
);
Expand Down

0 comments on commit f4f87af

Please sign in to comment.