Update
This commit is contained in:
parent
b7dec6bfa2
commit
7a6e211d2e
@ -142,6 +142,10 @@ updateImgs();
|
|||||||
function purchaseItem() {
|
function purchaseItem() {
|
||||||
const purchaseBtn = document.getElementById('remember-to-add-auth-verificartion-to-js-handler')
|
const purchaseBtn = document.getElementById('remember-to-add-auth-verificartion-to-js-handler')
|
||||||
if (purchaseBtn.innerHTML == "Buy!") {
|
if (purchaseBtn.innerHTML == "Buy!") {
|
||||||
|
purchaseBtn.setAttribute("style", "background: #ff813d; width:300px;")
|
||||||
|
purchaseBtn.innerHTML = "Confirm?"
|
||||||
|
}
|
||||||
|
else if (purchaseBtn.innerHTML == "Confirm?") {
|
||||||
if (firebase.auth().currentUser) {
|
if (firebase.auth().currentUser) {
|
||||||
firebase.auth().currentUser.getIdToken().then(function(idToken) {
|
firebase.auth().currentUser.getIdToken().then(function(idToken) {
|
||||||
var item_id_element = document.getElementById("productID")
|
var item_id_element = document.getElementById("productID")
|
||||||
@ -163,7 +167,7 @@ function purchaseItem() {
|
|||||||
.then(function(result){
|
.then(function(result){
|
||||||
console.log(result)
|
console.log(result)
|
||||||
if (result.success == true) {
|
if (result.success == true) {
|
||||||
purchaseBtn.setAttribute("style", "background: #00DD00; width:500px;")
|
purchaseBtn.setAttribute("style", "background: #00DD00; width:500px; transition: 0.7s;")
|
||||||
purchaseBtn.innerHTML = "Item Purchased, Congratulations!"
|
purchaseBtn.innerHTML = "Item Purchased, Congratulations!"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
Loading…
Reference in New Issue
Block a user