Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix missing id and deleting session storage #4520

Merged
merged 1 commit into from
May 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,8 @@ var wait_for_tx_to_mine_and_then_ping_server = function() {
console.log('success from sync/web', response);

// clear local data
delete sessionStorage['fulfillers'];
delete sessionStorage['bountyId'];
localStorage[document.issueURL] = '';
if (response['url']) {
document.location.href = response['url'];
Expand Down Expand Up @@ -1577,6 +1579,7 @@ const show_invite_users = () => {

if (sessionStorage['fulfillers']) {
const users = sessionStorage['fulfillers'].split(',');
const bountyId = sessionStorage['bountyId'];

if (users.length == 1) {

Expand All @@ -1586,7 +1589,7 @@ const show_invite_users = () => {
<div class="invite-user">
<img class="avatar" src="/dynamic/avatar/${users}" />
<p class="mt-4">
<a target="_blank" class="btn btn-gc-blue shadow-none py-2 px-4" href="/users?invite=${user}&current-bounty=${document.result.pk}">
<a target="_blank" class="btn btn-gc-blue shadow-none py-2 px-4" href="/users?invite=${user}&current-bounty=${bountyId}">
Yes, invite to one of my bounties
</a>
</p>
Expand All @@ -1608,7 +1611,7 @@ const show_invite_users = () => {
${user}
</a>
</p>
<a target="_blank" class="btn btn-gc-blue shadow-none px-4 font-body font-weight-semibold" href="/users?invite=${user}&current-bounty=${document.result.pk}"">
<a target="_blank" class="btn btn-gc-blue shadow-none px-4 font-body font-weight-semibold" href="/users?invite=${user}&current-bounty=${bountyId}"">
Invite
</a>
</div>`;
Expand All @@ -1620,7 +1623,6 @@ const show_invite_users = () => {
$('#invite-header').html(title);
$('#invite-users').html(invites);
}
delete sessionStorage['fulfillers'];
$('.invite-user-container').removeClass('hidden');
$('.quote-container').addClass('hidden');
} else {
Expand Down
3 changes: 2 additions & 1 deletion app/assets/v2/js/pages/bulk_payout.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ const getFulfillers = () => {
fulfillers.push($('.new-user option')[i].innerHTML);
}
sessionStorage['fulfillers'] = fulfillers;
sessionStorage['bountyId'] = $('#bountyId').val();
};

$(document).on('click', '.user-fulfiller', function(event) {
Expand All @@ -380,4 +381,4 @@ $(document).on('click', '.user-fulfiller', function(event) {
$search.val(term);
$search.trigger('input');

});
});