From 2152cf87d773197826d32a4ed6dd6553886f01b9 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Wed, 1 Oct 2025 21:01:27 -0700 Subject: [PATCH] Tweak license badge and fix keyring dep --- src-tauri/Cargo.toml | 12 +++++----- src-tauri/yaak-crypto/Cargo.toml | 2 +- src-tauri/yaak-plugins/Cargo.toml | 8 +++---- src-web/components/LicenseBadge.tsx | 11 ++------- .../components/Settings/SettingsLicense.tsx | 23 +++++++++++-------- src-web/components/core/BadgeButton.tsx | 12 ++++++++-- 6 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index f742d1b4..08466b75 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -91,21 +91,21 @@ yaak-ws = { path = "yaak-ws" } [workspace.dependencies] chrono = "0.4.41" hex = "0.4.3" -keyring = { version = "3.6.3", features = ["apple-native", "windows-native", "sync-secret-service"] } +keyring = "3.6.3" reqwest = "0.12.20" +reqwest_cookie_store = "0.8.0" +rustls = { version = "0.23.27", default-features = false } +rustls-platform-verifier = "0.6.0" serde = "1.0.219" serde_json = "1.0.140" +sha2 = "0.10.9" tauri = "2.8.5" tauri-plugin = "2.4.0" tauri-plugin-dialog = "2.4.0" tauri-plugin-shell = "2.3.1" -tokio = "1.45.1" thiserror = "2.0.12" +tokio = "1.45.1" ts-rs = "11.0.1" -reqwest_cookie_store = "0.8.0" -rustls = { version = "0.23.27", default-features = false } -rustls-platform-verifier = "0.6.0" -sha2 = "0.10.9" yaak-common = { path = "yaak-common" } yaak-crypto = { path = "yaak-crypto" } yaak-fonts = { path = "yaak-fonts" } diff --git a/src-tauri/yaak-crypto/Cargo.toml b/src-tauri/yaak-crypto/Cargo.toml index a634439d..24e437eb 100644 --- a/src-tauri/yaak-crypto/Cargo.toml +++ b/src-tauri/yaak-crypto/Cargo.toml @@ -9,7 +9,7 @@ publish = false base32 = "0.5.1" # For encoding human-readable key base64 = "0.22.1" # For encoding in the database chacha20poly1305 = "0.10.1" -keyring = { workspace = true } +keyring = { workspace = true, features = ["apple-native", "windows-native", "sync-secret-service"] } log = "0.4.26" serde = { workspace = true, features = ["derive"] } tauri = { workspace = true } diff --git a/src-tauri/yaak-plugins/Cargo.toml b/src-tauri/yaak-plugins/Cargo.toml index b58ac9c8..c4edc876 100644 --- a/src-tauri/yaak-plugins/Cargo.toml +++ b/src-tauri/yaak-plugins/Cargo.toml @@ -7,8 +7,11 @@ publish = false [dependencies] base64 = "0.22.1" +chrono = { workspace = true } dunce = "1.0.4" futures-util = "0.3.30" +hex = { workspace = true } +keyring = { workspace = true, features = ["apple-native", "windows-native", "sync-secret-service"] } log = "0.4.21" md5 = "0.7.0" path-slash = "0.2.1" @@ -17,21 +20,18 @@ regex = "1.10.6" reqwest = { workspace = true, features = ["json"] } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } +sha2 = { workspace = true } tauri = { workspace = true } tauri-plugin-shell = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["macros", "rt-multi-thread", "process"] } tokio-tungstenite = "0.26.1" ts-rs = { workspace = true, features = ["import-esm"] } -sha2 = { workspace = true } yaak-common = { workspace = true } yaak-crypto = { workspace = true } yaak-models = { workspace = true } yaak-templates = { workspace = true } zip-extract = "0.4.0" -chrono = { workspace = true } -hex = { workspace = true } -keyring = { workspace = true } [build-dependencies] tauri-plugin = { workspace = true, features = ["build"] } diff --git a/src-web/components/LicenseBadge.tsx b/src-web/components/LicenseBadge.tsx index 001fd3f7..405f34f2 100644 --- a/src-web/components/LicenseBadge.tsx +++ b/src-web/components/LicenseBadge.tsx @@ -15,7 +15,7 @@ const details: Record< commercial_use: null, invalid_license: { label: 'License Error', color: 'danger' }, personal_use: { label: 'Personal Use', color: 'notice' }, - trialing: { label: 'Personal Use', color: 'info' }, + trialing: { label: 'Trialing', color: 'info' }, }; export function LicenseBadge() { @@ -46,11 +46,6 @@ function LicenseBadgeCmp() { return null; } - // User is trialing but has already seen the message, so hide badge - if (check.data.type === 'trialing') { - return null; - } - const detail = details[check.data.type]; if (detail == null) { return null; @@ -59,9 +54,7 @@ function LicenseBadgeCmp() { return ( { - openSettings.mutate('license'); - }} + onClick={() => openSettings.mutate('license')} > {detail.label} diff --git a/src-web/components/Settings/SettingsLicense.tsx b/src-web/components/Settings/SettingsLicense.tsx index 9cd57654..9fe432ba 100644 --- a/src-web/components/Settings/SettingsLicense.tsx +++ b/src-web/components/Settings/SettingsLicense.tsx @@ -35,17 +35,17 @@ function SettingsLicenseCmp() { {check.data?.type === 'commercial_use' ? ( Your license is active 🥳 ) : check.data?.type == 'trialing' ? ( - -

+ +

{pluralizeCount('day', differenceInDays(check.data.end, new Date()))} remaining {' '} - on trial + on your commercial-use trial

) : check.data?.type == 'personal_use' ? ( - -

Your free trial has ended

+ +

You are able to use Yaak for personal use only

) : null} @@ -98,16 +98,21 @@ function SettingsLicenseCmp() { ) : ( - + )} diff --git a/src-web/components/core/BadgeButton.tsx b/src-web/components/core/BadgeButton.tsx index 349e94ba..e66796ef 100644 --- a/src-web/components/core/BadgeButton.tsx +++ b/src-web/components/core/BadgeButton.tsx @@ -1,6 +1,14 @@ +import classNames from 'classnames'; import type { ButtonProps } from './Button'; import { Button } from './Button'; -export function BadgeButton(props: ButtonProps) { - return