diff --git a/static/components/customer-stall-list/customer-stall-list.html b/static/components/customer-stall-list/customer-stall-list.html index 9fd6658..15c6d7f 100644 --- a/static/components/customer-stall-list/customer-stall-list.html +++ b/static/components/customer-stall-list/customer-stall-list.html @@ -25,9 +25,7 @@ - + diff --git a/static/components/customer-stall/customer-stall.js b/static/components/customer-stall/customer-stall.js index d231991..e3aa495 100644 --- a/static/components/customer-stall/customer-stall.js +++ b/static/components/customer-stall/customer-stall.js @@ -65,13 +65,6 @@ async function customerStall(path) { z => z.id == this.checkoutDialog.data.shippingzone ) return +this.cart.total + zoneCost.cost - }, - dropIn() { - return { - privkey: this.customerPrivkey, - pubkey: this.customerPubkey, - useExtension: this.customerUseExtension - } } }, methods: { @@ -97,33 +90,10 @@ async function customerStall(path) { getAmountFormated(amount, unit = 'USD') { return LNbits.utils.formatCurrency(amount, unit) }, - updateQty(id, qty) { - let prod = this.cart.products - let product = prod.get(id) - prod.set(id, { - ...product, - quantity: qty - }) - this.updateCart() - }, addToCart(item) { this.$emit('add-to-cart', item) }, - updateCart() { - this.cart.total = 0 - this.cart.products.forEach(p => { - this.cart.total += p.quantity * p.price - }) - this.cart.size = this.cart.products.size - this.cartMenu = Array.from(this.cart.products, item => { - return {id: item[0], ...item[1]} - }) - this.$q.localStorage.set(`diagonAlley.carts.${this.stall.id}`, { - ...this.cart, - products: Object.fromEntries(this.cart.products) - }) - }, resetCart() { this.cart = { total: 0, @@ -145,7 +115,7 @@ async function customerStall(path) { email: orderData?.email }, items: Array.from(this.cart.products, p => { - return {product_id: p[0], quantity: p[1].quantity} + return { product_id: p[0], quantity: p[1].quantity } }), shipping_id: orderData.shippingzone } @@ -162,29 +132,12 @@ async function customerStall(path) { this.customerUseExtension = true this.checkoutDialog.data.pubkey = this.customerPubkey }, - async generateKeyPair() { - this.customerPrivkey = NostrTools.generatePrivateKey() - this.customerPubkey = NostrTools.getPublicKey(this.customerPrivkey) - this.customerUseExtension = false - this.checkoutDialog.data.pubkey = this.customerPubkey - this.checkoutDialog.data.privkey = this.customerPrivkey - }, + checkLogIn() { this.customerPubkey = this.account?.pubkey this.customerPrivkey = this.account?.privkey this.customerUseExtension = this.account?.useExtension }, - openCheckout() { - // Check if user is logged in - this.checkLogIn() - if (this.customerPubkey) { - this.checkoutDialog.data.pubkey = this.customerPubkey - if (this.customerPrivkey && !this.useExtension) { - this.checkoutDialog.data.privkey = this.customerPrivkey - } - } - this.checkoutDialog.show = true - }, resetCheckout() { this.loading = false this.checkoutDialog = { @@ -229,7 +182,7 @@ async function customerStall(path) { email: orderData?.email }, items: Array.from(this.cart.products, p => { - return {product_id: p[0], quantity: p[1].quantity} + return { product_id: p[0], quantity: p[1].quantity } }), shipping_id: orderData.shippingzone, type: 0 @@ -327,7 +280,7 @@ async function customerStall(path) { console.error(`Error: ${err}`) } }, - messageFilter(text, cb = () => {}) { + messageFilter(text, cb = () => { }) { if (!isJson(text)) return let json = JSON.parse(text) if (json.id != this.activeOrder) return @@ -372,7 +325,7 @@ async function customerStall(path) { this.cart.products = new Map(Object.entries(storedCart.products)) this.cartMenu = Array.from(this.cart.products, item => { - return {id: item[0], ...item[1]} + return { id: item[0], ...item[1] } }) } setTimeout(() => { diff --git a/static/components/market-config/market-config.html b/static/components/market-config/market-config.html index 365ea1a..82c9ddb 100644 --- a/static/components/market-config/market-config.html +++ b/static/components/market-config/market-config.html @@ -101,9 +101,11 @@ - + + @@ -115,8 +117,8 @@ - - + + diff --git a/static/components/market-config/market-config.js b/static/components/market-config/market-config.js index 92b9b3e..46ede54 100644 --- a/static/components/market-config/market-config.js +++ b/static/components/market-config/market-config.js @@ -19,7 +19,8 @@ async function marketConfig(path) { ui: { picture: null, banner: null, - theme: null + theme: null, + darkMode: false } }, themeOptions: [ diff --git a/static/components/shopping-cart/shopping-cart.html b/static/components/shopping-cart/shopping-cart.html index 640d0a8..b23c69c 100644 --- a/static/components/shopping-cart/shopping-cart.html +++ b/static/components/shopping-cart/shopping-cart.html @@ -15,7 +15,7 @@ standout :max="products.find(pr => pr.id == p.id).quantity" > - + diff --git a/templates/nostrmarket/market.html b/templates/nostrmarket/market.html index 96de390..1e72809 100644 --- a/templates/nostrmarket/market.html +++ b/templates/nostrmarket/market.html @@ -150,7 +150,30 @@ - + + + + + Account Setup + + + + Enter your Nostr private key or generate a new one. + + + + + + + + createAccount()"> + + Close + + + +
Enter your Nostr private key or generate a new one.