mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Update contact.page.js (#18171)
Co-authored-by: Eric <eashaw@sailsjs.com>
This commit is contained in:
parent
ffddd76b9c
commit
8d810a3a03
1 changed files with 6 additions and 5 deletions
11
website/assets/js/pages/contact.page.js
vendored
11
website/assets/js/pages/contact.page.js
vendored
|
|
@ -48,7 +48,11 @@ parasails.registerPage('contact', {
|
|||
if(this.formToShow === 'contact'){
|
||||
this.formToDisplay = this.formToShow;
|
||||
}
|
||||
if(this.prefillFormDataFromUserRecord){
|
||||
if(this.primaryBuyingSituation){ // If the user has a priamry buying situation set in their sesssion, pre-fill the form.
|
||||
// Note: this will be overriden if the user is logged in and has a primaryBuyingSituation set in the database.
|
||||
this.formData.primaryBuyingSituation = this.primaryBuyingSituation;
|
||||
}
|
||||
if(this.prefillFormDataFromUserRecord){// prefill from database
|
||||
this.formDataToPrefillForLoggedInUsers.emailAddress = this.me.emailAddress;
|
||||
this.formDataToPrefillForLoggedInUsers.firstName = this.me.firstName;
|
||||
this.formDataToPrefillForLoggedInUsers.lastName = this.me.lastName;
|
||||
|
|
@ -59,12 +63,9 @@ parasails.registerPage('contact', {
|
|||
}
|
||||
this.formData = _.clone(this.formDataToPrefillForLoggedInUsers);
|
||||
}
|
||||
if(window.location.search){
|
||||
if(window.location.search){// auto-clear query string (TODO: Document why we're doing this further. I think this shouldn't exist in the frontend code, instead in the hook. Because analytics corruption.)
|
||||
window.history.replaceState({}, document.title, '/contact' );
|
||||
}
|
||||
if(this.primaryBuyingSituation){
|
||||
this.formData.primaryBuyingSituation = this.primaryBuyingSituation;// prefill form
|
||||
}
|
||||
},
|
||||
mounted: async function() {
|
||||
//…
|
||||
|
|
|
|||
Loading…
Reference in a new issue