Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Aug 20, 2020
2 parents d8f25a7 + b96ece1 commit 74f1ab4
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/assets/v2/js/pages/faucet_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ $('document').ready(function() {

$('#submitFaucet').on('click', function(e) {
e.preventDefault();
if (!web3Modal.cachedProvider) {
if (web3Modal && !web3Modal.cachedProvider) {
onConnect().then(() => {
trigger_faucet_form_web3_hooks(provider);
});
Expand Down
6 changes: 6 additions & 0 deletions app/assets/v2/js/pages/kudos_bulk_receive.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ $(document).ready(function() {
if (!checked) {
return;
}

if (!web3) {
_alert({ message: gettext('Please connect to a web3 wallet.')}, 'error');
return;
}

amount = document.gas_amount * 10 ** 18;
var to_address = '0x6239FF1040E412491557a7a02b2CBcC5aE85dc8F';

Expand Down
2 changes: 1 addition & 1 deletion app/assets/v2/js/pages/leaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var removeFilter = function() {

$(document).ready(function() {
var document_url_object = new URL(document.location.href);
var keyword_search = document_url_object.searchParams.get('keyword');
var keyword_search = document_url_object.searchParam && document_url_object.searchParams.get('keyword');

technologies.forEach(function(tech) {
if (keyword_search === tech) {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/v2/js/pages/process_faucet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $(document).ready(function() {

$('#submitFaucet').on('click', function(e) {
e.preventDefault();
if (!web3Modal.cachedProvider) {
if (web3Modal && !web3Modal.cachedProvider) {
onConnect();
return false;
}
Expand Down
10 changes: 7 additions & 3 deletions app/assets/v2/js/pages/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,13 @@ function communityChart() {

// TODO: DRY
function jdiChart() {
var data = google.visualization.arrayToDataTable(document.jdi_history);

var options = {
if (!google || !google.visualization)
return;

const data = google.visualization.arrayToDataTable(document.jdi_history);

const options = {
curveType: 'function',
legend: { position: 'none' },
backgroundColor: 'transparent',
Expand All @@ -88,7 +92,7 @@ function jdiChart() {
series: { 0: { color: '#15003E' } }
};

var chart = new google.visualization.LineChart(document.getElementById('jdi_chart'));
const chart = new google.visualization.LineChart(document.getElementById('jdi_chart'));

chart.draw(data, options);
}
Expand Down
2 changes: 1 addition & 1 deletion app/assets/v2/js/user_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let popoverData = [];
let controller = null;

const renderPopOverData = function(data) {
const unique_orgs = data.profile.orgs ? Array.from(new Set(data.profile.orgs)) : [];
const unique_orgs = data && data.profile && data.profile.orgs ? Array.from(new Set(data.profile.orgs)) : [];
let orgs = unique_orgs && unique_orgs.map((_organization, index) => {
if (index < 5) {
return `<a href="/${_organization}" class="link-current" data-toggle="tooltip" data-container=".popover-user-card" data-original-title="${_organization}">
Expand Down
8 changes: 4 additions & 4 deletions app/assets/v2/js/user_popover.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let popoverData = [];
let _popoverData = [];

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

if (popoverData.filter(index => index[contributor]).length === 0) {
if (_popoverData.filter(index => index[contributor]).length === 0) {
if (controller) {
controller.abort();
}
Expand All @@ -97,7 +97,7 @@ function openContributorPopOver(contributor, element) {
userRequest = fetch(contributorURL, { method: 'GET', signal })
.then(response => response.json())
.then(response => {
popoverData.push({ [contributor]: response });
_popoverData.push({ [contributor]: response });
controller = null;
element.popover({
placement: 'auto',
Expand Down Expand Up @@ -146,7 +146,7 @@ function openContributorPopOver(contributor, element) {
<div class="popover-body"></div>
</div>`,
content: renderPopOverData(
popoverData.filter(item => item[contributor])[0][contributor]
_popoverData.filter(item => item[contributor])[0][contributor]
),
html: true
}).on('mouseenter', function() {
Expand Down
4 changes: 2 additions & 2 deletions app/retail/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,8 +1114,8 @@ def create_status_update(request):
meta['image'] = request.POST.get('image', '')

kwargs['profile'] = profile
if ':' in request.POST.get('what'):
what = request.POST.get('what')
what = request.POST.get('what')
if what and ':' in what:
key = what.split(':')[0]
result = what.split(':')[1]
if key and result:
Expand Down

0 comments on commit 74f1ab4

Please sign in to comment.