Skip to content
This repository has been archived by the owner on Jan 17, 2021. It is now read-only.

Commit

Permalink
Added validation check for input field not to move forward if no data…
Browse files Browse the repository at this point in the history
… inputed
  • Loading branch information
mrgodhani committed Aug 12, 2018
1 parent b386751 commit c6477c2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ footer {
.form-control {
padding-left: 0;
padding-bottom: 8px !important;
outline: none;
border: none;
border-bottom: 2px solid rgba(0, 0, 0, 1);
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/components/Lyft.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ export default {
} else if (this.filter_option === 'lastthreemonths') {
startDate = dayjs().subtract(3, 'month').startOf('month').unix()
endDate = dayjs().startOf('month').unix()
} else {
return
}
const list = await axios.get(`https://www.googleapis.com/gmail/v1/users/me/messages?q='from:"Lyft Ride Receipt" after:${startDate} before:${endDate}'`, {
Expand Down
18 changes: 13 additions & 5 deletions src/renderer/components/Uber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:readonly="!emailError"
:state="emailError"
aria-describedby="email emailFeedback"
placeholder="Email Address"></b-form-input>
placeholder="Email Address" required></b-form-input>
<b-form-invalid-feedback id="emailFeedback">
'Oops! There is no account associated with this email address.'
</b-form-invalid-feedback>
Expand Down Expand Up @@ -502,16 +502,24 @@ export default {
submitForm () {
switch (this.form) {
case 'EMAIL':
this.$electron.ipcRenderer.send('email', this.fields.email)
if (this.fields.email) {
this.$electron.ipcRenderer.send('email', this.fields.email)
}
break
case 'PASSWORD':
this.$electron.ipcRenderer.send('password', this.fields.password)
if (this.fields.password) {
this.$electron.ipcRenderer.send('password', this.fields.password)
}
break
case 'VERIFICATION':
this.$electron.ipcRenderer.send('code', this.fields.verification_code)
if (this.fields.verification_code) {
this.$electron.ipcRenderer.send('code', this.fields.verification_code)
}
break
case 'FILTER_OPTION':
this.$electron.ipcRenderer.send('filter_option', this.fields.filter_option)
if (this.fields.filter_option) {
this.$electron.ipcRenderer.send('filter_option', this.fields.filter_option)
}
break
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/services/puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,9 @@ export default async function () {

await page.click(PASSWORD_SELECTOR)
ipcRenderer.send('form', PASSWORD)
await page.keyboard.type(await listenEvent('passdata'), {delay: 30})
await page.keyboard.type(await listenEvent('passdata'), {delay: 60})
await page.click(NEXT_BUTTON)
await page.waitFor(1000)

const evaluateErrorPass = await evaluateError(page)
// Evaluate Password Error
Expand All @@ -278,9 +279,10 @@ export default async function () {
return false
})

console.log(verificationCode)
if (verificationCode) {
await page.click(SMS_SELECTOR)
ipcRenderer.send('form', VERIFICATION)
await page.click(SMS_SELECTOR)
await page.keyboard.type(await listenEvent('codedata'), { delay: 30 })
await page.click(VERIFY_BUTTON)
}
Expand Down

0 comments on commit c6477c2

Please sign in to comment.