From 3d9b012cc2ca7484c9916eb7addd4d6e33004a3d Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sun, 31 May 2026 16:08:58 -0400 Subject: [PATCH] Preview pane: hide data-dependent buttons on locked premium MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three preview-pane actions consume the design payload, not just the watermarked-preview envelope, so they shouldn't appear until the buyer unlocks: - Print / Save PDF — loadProjectFromText against a locked envelope just loads the encrypted blob, not the printable artboard. Hidden until unlock. - Start Presentation (deck) — startPresenter walks payload.deck /slides which carry the multi-page slide data; on a locked deck the envelope only has watermarked slide-preview JPEGs. - Import into Disc 1 / Import into Disc 2 (disc-design) — importDiscDesignFromPayload reads payload.discDesign, which isn't present on a locked envelope. All three gated with `&& !lockedPremium`. The Use/Fork button already transforms to "Unlock for N sats" for the same reason, Save JSON is disabled, and Share / Tip / Block-report-overflow stay available since they don't need the design data. --- src/index.html | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/index.html b/src/index.html index 3d29cc0..80f109c 100644 --- a/src/index.html +++ b/src/index.html @@ -22308,8 +22308,10 @@ } // Decks get a Start Presentation button — present straight from the - // browser without forking. - if (mode === 'deck') { + // browser without forking. Locked premium decks only carry the + // watermarked previews, not the full slide data, so hide the + // button until unlock. + if (mode === 'deck' && !lockedPremium) { const presentBtn = document.createElement('button'); presentBtn.type = 'button'; presentBtn.textContent = '▶ Start Presentation'; @@ -22378,7 +22380,10 @@ actionsDiv.insertBefore(dlBtn, saveJsonBtn); } - if (isDiscDesign) { + // Mode-specific import / print actions all depend on the + // design data, so hide them on locked premium rows — the + // envelope only carries watermarked previews until unlock. + if (isDiscDesign && !lockedPremium) { const import1Btn = document.createElement('button'); import1Btn.type = 'button'; import1Btn.textContent = 'Import into Disc 1'; @@ -22409,10 +22414,12 @@ actionsDiv.insertBefore(import1Btn, saveJsonBtn); actionsDiv.insertBefore(import2Btn, saveJsonBtn); - } else if (mode !== 'pixelart') { + } else if (mode !== 'pixelart' && !lockedPremium) { // Pixel-art designs have their own PNG / GIF download button // a few lines up — Print / Save PDF doesn't make sense for - // raster sprites at small native resolutions. + // raster sprites at small native resolutions. Locked premium + // rows skip print too: the printable content is encrypted + // until the buyer pays. const printBtn = document.createElement('button'); printBtn.type = 'button'; printBtn.textContent = 'Print / Save PDF';