Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Small Technology Foundation web site
spikes
patronage
Commits
05a510b8
Verified
Commit
05a510b8
authored
Aug 02, 2019
by
Aral Balkan
Browse files
Fix validation
parent
744c966f
Changes
1
Hide whitespace changes
Inline
Side-by-side
.dynamic/client/patron.js
View file @
05a510b8
...
...
@@ -19,9 +19,9 @@ window.addEventListener('load', _ => {
// Interface
//
function
confirmCancellation
()
{
async
function
confirmCancellation
()
{
// return window.confirm('Are you sure you want to cancel your patronage?')
return
SweetAlert2
.
fire
({
return
(
await
SweetAlert2
.
fire
({
title
:
'
Are you sure you want to cancel your patronage?
'
,
text
:
""
,
type
:
'
warning
'
,
...
...
@@ -30,7 +30,7 @@ window.addEventListener('load', _ => {
cancelButtonColor
:
'
#d33
'
,
confirmButtonText
:
'
Yes
'
,
cancelButtonText
:
'
No
'
})
})
).
value
}
function
handleCommand
(
commandName
)
{
...
...
@@ -44,12 +44,10 @@ window.addEventListener('load', _ => {
if
(
commandName
===
'
update
'
)
command
.
amount
=
$
(
'
#patronageAmount
'
).
value
let
confirm
=
false
if
(
commandName
===
'
cancel
'
)
confirm
=
await
confirmCancellation
()
console
.
log
(
'
confirm
'
,
confirm
)
let
proceed
=
true
if
(
commandName
===
'
cancel
'
)
proceed
=
await
confirmCancellation
()
if
(
!
confirm
.
value
)
return
if
(
!
proceed
)
return
socket
.
send
(
JSON
.
stringify
(
command
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment