diff --git a/public/index.html b/public/index.html index 6abc92a..e94f8ee 100644 --- a/public/index.html +++ b/public/index.html @@ -1360,7 +1360,7 @@ // free-tier users, surface the upgrade prompt instead of opening an // empty sidebar. if (!hasEntitlement("history")) { - showToast("Library is a paid feature — keep every summary you process. Tap upgrade to unlock.", "📚"); + showToast("Library requires a paid license — every summary you process gets saved.", "📚"); return; } toggleHistory(); @@ -1369,7 +1369,7 @@ function handleSubscribeClick() { // Subscriptions / channel auto-queue is Pro-only. if (!hasEntitlement("subscriptions")) { - showToast("Channel & podcast subscriptions are a Pro feature. Upgrade to auto-summarize new uploads.", "📡"); + showToast("Channel & podcast subscriptions are a Pro-tier feature.", "📡"); return; } addSubscriptionFromInput(); @@ -1666,10 +1666,37 @@ render(); } - function renderFreeBanner() { + // True for anyone who isn't on the top tier — drives whether to show + // the persistent upgrade banner. Covers: unlicensed, unlicensed-skipped, + // Core (full or partial), and any "licensed but missing entitlements" + // anomaly. Pro users see no banner. + function shouldShowUpgradeBanner() { + if (!state.license || !state.license.loaded) return false; + return !isProTier(); + } + + function renderUpgradeBanner() { const buyUrl = upgradeToProUrl(); + const free = !isLicensed(); + const partialCore = isLicensed() && (!hasEntitlement("history") || !hasEntitlement("library")); + const fullCore = isLicensed() && hasEntitlement("history") && hasEntitlement("library") && !isProTier(); + + let label, descr; + if (free) { + label = "Free mode"; + descr = "one video at a time · no library, no subscriptions"; + } else if (partialCore) { + label = "Limited license"; + descr = "your license is missing some Core features — contact the seller or upgrade"; + } else if (fullCore) { + label = "Core tier"; + descr = "upgrade to Pro for channel & podcast subscriptions, auto-queue, and clips"; + } else { + return ""; // shouldn't reach + } + return ` -
`; } @@ -1741,7 +1769,9 @@ // a server-side key set via the StartOS config action. const submitDisabled = !state.url.trim() || (!isSubscribeUrl(state.url) && !state.apiKey.trim() && !state.hasServerKey); - app.innerHTML = ` + let __renderedHtml; + try { + __renderedHtml = `