This commit is contained in:
Max Hunt 2020-05-12 16:20:12 +01:00
parent b7dec6bfa2
commit 7a6e211d2e
2 changed files with 5 additions and 1 deletions

View File

@ -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