Skip to content

Commit 74f1ab4

Browse files
committed
Merge remote-tracking branch 'upstream/stable'
2 parents d8f25a7 + b96ece1 commit 74f1ab4

File tree

8 files changed

+23
-13
lines changed

8 files changed

+23
-13
lines changed

app/assets/v2/js/pages/faucet_form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $('document').ready(function() {
4646

4747
$('#submitFaucet').on('click', function(e) {
4848
e.preventDefault();
49-
if (!web3Modal.cachedProvider) {
49+
if (web3Modal && !web3Modal.cachedProvider) {
5050
onConnect().then(() => {
5151
trigger_faucet_form_web3_hooks(provider);
5252
});

app/assets/v2/js/pages/kudos_bulk_receive.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ $(document).ready(function() {
2222
if (!checked) {
2323
return;
2424
}
25+
26+
if (!web3) {
27+
_alert({ message: gettext('Please connect to a web3 wallet.')}, 'error');
28+
return;
29+
}
30+
2531
amount = document.gas_amount * 10 ** 18;
2632
var to_address = '0x6239FF1040E412491557a7a02b2CBcC5aE85dc8F';
2733

app/assets/v2/js/pages/leaderboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var removeFilter = function() {
66

77
$(document).ready(function() {
88
var document_url_object = new URL(document.location.href);
9-
var keyword_search = document_url_object.searchParams.get('keyword');
9+
var keyword_search = document_url_object.searchParam && document_url_object.searchParams.get('keyword');
1010

1111
technologies.forEach(function(tech) {
1212
if (keyword_search === tech) {

app/assets/v2/js/pages/process_faucet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ $(document).ready(function() {
1212

1313
$('#submitFaucet').on('click', function(e) {
1414
e.preventDefault();
15-
if (!web3Modal.cachedProvider) {
15+
if (web3Modal && !web3Modal.cachedProvider) {
1616
onConnect();
1717
return false;
1818
}

app/assets/v2/js/pages/results.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,13 @@ function communityChart() {
7676

7777
// TODO: DRY
7878
function jdiChart() {
79-
var data = google.visualization.arrayToDataTable(document.jdi_history);
8079

81-
var options = {
80+
if (!google || !google.visualization)
81+
return;
82+
83+
const data = google.visualization.arrayToDataTable(document.jdi_history);
84+
85+
const options = {
8286
curveType: 'function',
8387
legend: { position: 'none' },
8488
backgroundColor: 'transparent',
@@ -88,7 +92,7 @@ function jdiChart() {
8892
series: { 0: { color: '#15003E' } }
8993
};
9094

91-
var chart = new google.visualization.LineChart(document.getElementById('jdi_chart'));
95+
const chart = new google.visualization.LineChart(document.getElementById('jdi_chart'));
9296

9397
chart.draw(data, options);
9498
}

app/assets/v2/js/user_card.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let popoverData = [];
2727
let controller = null;
2828

2929
const renderPopOverData = function(data) {
30-
const unique_orgs = data.profile.orgs ? Array.from(new Set(data.profile.orgs)) : [];
30+
const unique_orgs = data && data.profile && data.profile.orgs ? Array.from(new Set(data.profile.orgs)) : [];
3131
let orgs = unique_orgs && unique_orgs.map((_organization, index) => {
3232
if (index < 5) {
3333
return `<a href="/${_organization}" class="link-current" data-toggle="tooltip" data-container=".popover-user-card" data-original-title="${_organization}">

app/assets/v2/js/user_popover.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let popoverData = [];
1+
let _popoverData = [];
22

33
const renderPopOverData = data => {
44
const unique_contributed_to = data.contributed_to ? Array.from(new Set(data.contributed_to)) : [];
@@ -87,7 +87,7 @@ function openContributorPopOver(contributor, element) {
8787
const keywords = document.result.keywords || '';
8888
const contributorURL = `/api/v0.1/profile/${contributor}?keywords=${keywords}`;
8989

90-
if (popoverData.filter(index => index[contributor]).length === 0) {
90+
if (_popoverData.filter(index => index[contributor]).length === 0) {
9191
if (controller) {
9292
controller.abort();
9393
}
@@ -97,7 +97,7 @@ function openContributorPopOver(contributor, element) {
9797
userRequest = fetch(contributorURL, { method: 'GET', signal })
9898
.then(response => response.json())
9999
.then(response => {
100-
popoverData.push({ [contributor]: response });
100+
_popoverData.push({ [contributor]: response });
101101
controller = null;
102102
element.popover({
103103
placement: 'auto',
@@ -146,7 +146,7 @@ function openContributorPopOver(contributor, element) {
146146
<div class="popover-body"></div>
147147
</div>`,
148148
content: renderPopOverData(
149-
popoverData.filter(item => item[contributor])[0][contributor]
149+
_popoverData.filter(item => item[contributor])[0][contributor]
150150
),
151151
html: true
152152
}).on('mouseenter', function() {

app/retail/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,8 +1114,8 @@ def create_status_update(request):
11141114
meta['image'] = request.POST.get('image', '')
11151115

11161116
kwargs['profile'] = profile
1117-
if ':' in request.POST.get('what'):
1118-
what = request.POST.get('what')
1117+
what = request.POST.get('what')
1118+
if what and ':' in what:
11191119
key = what.split(':')[0]
11201120
result = what.split(':')[1]
11211121
if key and result:

0 commit comments

Comments
 (0)