diff --git a/crates/desktop/artcraft/tauri-mac.conf.json b/crates/desktop/artcraft/tauri-mac.conf.json index 97f0544398..7732e7b09f 100644 --- a/crates/desktop/artcraft/tauri-mac.conf.json +++ b/crates/desktop/artcraft/tauri-mac.conf.json @@ -46,10 +46,10 @@ "img-src": "* data: blob: 'unsafe-inline'", "script-src": [ "'self'", + "https://*.clarity.ms", "https://*.fakeyou.com", "https://*.storyteller.ai", - "https://www.clarity.ms", - "https://scripts.clarity.ms", + "https://clarity.ms", "ipc://localhost", "tauri://localhost" ], diff --git a/crates/desktop/artcraft/tauri.conf.json b/crates/desktop/artcraft/tauri.conf.json index 97f0544398..7732e7b09f 100644 --- a/crates/desktop/artcraft/tauri.conf.json +++ b/crates/desktop/artcraft/tauri.conf.json @@ -46,10 +46,10 @@ "img-src": "* data: blob: 'unsafe-inline'", "script-src": [ "'self'", + "https://*.clarity.ms", "https://*.fakeyou.com", "https://*.storyteller.ai", - "https://www.clarity.ms", - "https://scripts.clarity.ms", + "https://clarity.ms", "ipc://localhost", "tauri://localhost" ], diff --git a/frontend/libs/state/credits/src/lib/state/credits-state.ts b/frontend/libs/state/credits/src/lib/state/credits-state.ts index d3b3592b70..5ef7442db8 100644 --- a/frontend/libs/state/credits/src/lib/state/credits-state.ts +++ b/frontend/libs/state/credits/src/lib/state/credits-state.ts @@ -26,7 +26,13 @@ export const useCreditsState = create()((set) => ({ // Call to fetch credits from the server fetchFromServer: async () => { - const data = await ArtcraftGetCredits(); + let data; + try { + data = await ArtcraftGetCredits(); + } catch (error) { + console.error("Error fetching credits", error); + return; + } if (!!data.payload) { set((state) => ({ freeCredits: data.payload.free_credits, @@ -36,4 +42,4 @@ export const useCreditsState = create()((set) => ({ })); } } -})) \ No newline at end of file +})) diff --git a/frontend/libs/state/subscription/src/lib/subscription-state.ts b/frontend/libs/state/subscription/src/lib/subscription-state.ts index fb3e0a6e71..740f451f97 100644 --- a/frontend/libs/state/subscription/src/lib/subscription-state.ts +++ b/frontend/libs/state/subscription/src/lib/subscription-state.ts @@ -52,10 +52,15 @@ export const useSubscriptionState = create()((set, get) => ({ // Call to fetch credits from the server fetchFromServer: async () => { - const data = await ArtcraftGetSubscription(); + let data; + try { + data = await ArtcraftGetSubscription(); + } catch (error) { + console.error("Error fetching subscription", error); + return; + } if (!!data.payload) { let activeSubscription = undefined; - console.log(">>> subscription data.payload", data.payload); if (!!data.payload.active_subscription) { activeSubscription = { subscriptionToken: data.payload.active_subscription.subscription_token, @@ -65,7 +70,6 @@ export const useSubscriptionState = create()((set, get) => ({ subscriptionEndAt: data.payload.active_subscription.subscription_end_at ? new Date(data.payload.active_subscription.subscription_end_at) : undefined, }; } - console.log(">>> activeSubscription", activeSubscription); set((state) => ({ subscriptionInfo: activeSubscription, })); diff --git a/script/artcraft/unix_build.sh b/script/artcraft/unix_build.sh index dff5bc3200..c8784693ca 100755 --- a/script/artcraft/unix_build.sh +++ b/script/artcraft/unix_build.sh @@ -24,8 +24,12 @@ popd || exit export TAURI_FRONTEND_PATH="${frontend_path}" export TAURI_APP_PATH="${rust_crate_path}" + +# NB: The "frontend dev" script sets "production" too, so this must only control the +# hostnames we use, not minification, etc. export VITE_ENVIRONMENT_TYPE="production" +# This appears to trigger "nx build" instead of "nx dev". cargo tauri build --config "${config_path}" echo "Done!"