From b4ca9fe65dc8a95082cb9399e633eb902e1a8266 Mon Sep 17 00:00:00 2001 From: Padreug Date: Sat, 3 Oct 2026 20:53:27 +0200 Subject: [PATCH 1/2] fix(ui): ticket waves never rendered in the organiser table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The expanded event row showed "Ticket waves" with a + button and an empty list, however many waves the event had. Reported from aio-demo and reproduced in a fresh incognito window, so not a caching artifact. The chip built its label inline with `LNbits.utils.formatCurrency(...)`. Vue resolves template expressions against the component instance, where the `LNbits` global is not in scope, so the expression threw TypeError: Cannot read properties of undefined (reading 'utils') and the whole v-for rendered nothing. The promo-code chips beside it were unaffected, which is what made the list look like a data problem — the waves were always present in the response. That line arrived with the v1.6.8 merge: it is upstream's, and upstream is the only `LNbits.` reference in any template in this extension (display.vue and ticket.vue have none). So the convention here was already "format in a method", and the merge quietly broke it. `waveSummary` now builds the label in index.js, where the global is in scope. It also trims the day off wave dates for display — closing_date defaults from event_end_date and can carry a time, which was rendering as "2026-12-09T16:00:00+01:00" in the chip. Verified in a browser against a two-wave event: both chips render as "Primary wave - 2026-10-03 to 2026-11-02 - €30.00 - 50 tickets - 0 sold" with no TypeError. --- static/js/index.js | 20 ++++++++++++++++++++ static/js/index.vue | 18 +----------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index edddaba..fc6e807 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -414,6 +414,26 @@ window.PageEvents = { this.ticketImageUploadTarget = null } }, + waveSummary(eventId, wave) { + // Built here, not in the template. Vue resolves template expressions + // against the component instance, where the `LNbits` global is NOT + // in scope — upstream's v1.6.8 chip called `LNbits.utils` inline and + // threw "Cannot read properties of undefined (reading 'utils')", + // which killed the whole v-for and left the wave list looking empty. + // No other template in this extension touches `LNbits` directly. + const price = this.isFiatCurrency(wave.currency) + ? LNbits.utils.formatCurrency( + Number(wave.price_per_ticket || 0).toFixed(2), + wave.currency + ) + : `${wave.price_per_ticket} sats` + // Wave dates can carry a time (closing_date defaults from + // event_end_date); show the day only. + const opens = String(wave.opening_date || '').slice(0, 10) + const closes = String(wave.closing_date || '').slice(0, 10) + const sold = this.soldTicketsForWave(eventId, wave.id) + return `${wave.title} - ${opens} to ${closes} - ${price} - ${wave.amount_tickets} tickets - ${sold} sold` + }, soldTicketsForWave(eventId, waveId) { return this.allPaidTickets.filter( ticket => diff --git a/static/js/index.vue b/static/js/index.vue index 3ffe9bb..4795a3c 100644 --- a/static/js/index.vue +++ b/static/js/index.vue @@ -271,23 +271,7 @@ > From cadf30b70449471729d16cde0dc6841e8595ec11 Mon Sep 17 00:00:00 2001 From: Padreug Date: Sat, 3 Oct 2026 21:06:55 +0200 Subject: [PATCH 2/2] chore(release): v1.6.8-aio.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - #68 ticket waves never rendered in the organiser table. The chip built its label inline with `LNbits.utils.formatCurrency(...)`, but Vue resolves template expressions against the component instance, where the `LNbits` global is not in scope. It threw "Cannot read properties of undefined (reading 'utils')" and the whole v-for rendered nothing, so every event showed an empty wave list however many waves it had. Organisers could not see or edit a wave from the LNbits UI at all. The line came in with the v1.6.8 merge: it is upstream's, and the only `LNbits.` reference in any template here — display.vue and ticket.vue have none. `waveSummary` now builds the label in index.js, and trims the time off wave dates for display. Frontend only; no Python, no schema, no migration. Verified in a browser against a two-wave event before tagging: both chips render with formatted currency and no TypeError. --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 1a689ed..f7e0ec1 100644 --- a/config.json +++ b/config.json @@ -1,6 +1,6 @@ { "id": "events", - "version": "1.6.8-aio.3", + "version": "1.6.8-aio.4", "name": "Events", "repo": "https://git.atitlan.io/aiolabs/events", "short_description": "Sell and register event tickets",