Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Redirect to member registration on oneclick if member hasn't register…
Browse files Browse the repository at this point in the history
…ed yet.
  • Loading branch information
osahyoun committed Sep 26, 2016
1 parent dd32cba commit 9be718b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/assets/javascripts/member-facing/backbone/fundraiser.js
Expand Up @@ -303,19 +303,26 @@ const Fundraiser = Backbone.View.extend(_.extend(CurrencyMethods, {
},

onOneClickSuccess() {
this.followRedirect(this.followUpUrl);
if ( this.memberShouldRegister() )
this.followRedirect(this.registrationPath(window.champaign.personalization.member.email));
else
this.followRedirect(this.followUpUrl);
},

transactionSuccess() {
const user = this.serializeUserForm();
let url = this.followUpUrl;

if ( this.memberShouldRegister() )
url = `/member_authentication/new?page_id=${this.pageId}&email=${encodeURIComponent(user.email)}`;
url = this.registrationPath(user.email);

this.followRedirect(url);
},

registrationPath(email) {
return `/member_authentication/new?page_id=${this.pageId}&email=${encodeURIComponent(email)}`;
},

onOneClickFailed() {
this.enableOneClickButton();
},
Expand Down

0 comments on commit 9be718b

Please sign in to comment.