mirror of
https://github.com/PR0M3TH3AN/Artstr-Studio.git
synced 2026-10-27 08:40:39 +00:00
Preview pane: hide data-dependent buttons on locked premium
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.
This commit is contained in:
1 parent
817ab051f0
commit
3d9b012cc2
1 file changed
+12
-5
+12
-5
@@ -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';
|
||||
|
||||
Reference in new issue
Block a user