| 1 | // This is a campaign identity, not an application version. Minor upgrades must |
| 2 | // not reset it. No configuration, session or updater data is written here. |
| 3 | export const STUDIO_DISCOVERY_KEY = "reasonix.studio-introduction.v1"; |
| 4 | export const STUDIO_DOWNLOAD_URL = "https://reasonix.io/?download=studio#start"; |
| 5 | |
| 6 | export function isStableOneVersion(version: string): boolean { |
| 7 | return /^v?1\.\d+\.\d+$/.test(version.trim()); |
| 8 | } |
| 9 | |
| 10 | export function studioIntroductionPending(): boolean { |
| 11 | try { |
| 12 | return window.localStorage.getItem(STUDIO_DISCOVERY_KEY) === null; |
| 13 | } catch { |
| 14 | // Without durable dismissal, automatic promotion could repeat every launch. |
| 15 | return false; |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | export function claimStudioIntroduction(): boolean { |
| 20 | if (!studioIntroductionPending()) return false; |
| 21 | try { |
| 22 | window.localStorage.setItem(STUDIO_DISCOVERY_KEY, "seen"); |
| 23 | return true; |
| 24 | } catch { |
| 25 | return false; |
| 26 | } |
| 27 | } |
| 28 |