diff --git a/frontend/src/components/AIPanel.tsx b/frontend/src/components/AIPanel.tsx
index 814d8b7..b1c9f51 100644
--- a/frontend/src/components/AIPanel.tsx
+++ b/frontend/src/components/AIPanel.tsx
@@ -194,9 +194,9 @@ export default function AIPanel({ onReprocess, whisperModel, setWhisperModel }:
{!canUseAI ? (
-
AI editing requires a license
+
AI editing requires Business
- Upgrade to Pro or Business to unlock filler word removal, clip suggestions, and more.
+ Upgrade to Business to unlock filler word removal, clip suggestions, and more.
setShowLicenseDialog(true)}
@@ -305,9 +305,9 @@ export default function AIPanel({ onReprocess, whisperModel, setWhisperModel }:
{!canUseAI ? (
-
AI clip suggestions require a license
+
AI clip suggestions require Business
- Upgrade to Pro or Business to find the best segments for social media clips.
+ Upgrade to Business to find the best segments for social media clips.
setShowLicenseDialog(true)}
diff --git a/frontend/src/store/licenseStore.test.ts b/frontend/src/store/licenseStore.test.ts
index d155c32..5330092 100644
--- a/frontend/src/store/licenseStore.test.ts
+++ b/frontend/src/store/licenseStore.test.ts
@@ -53,6 +53,12 @@ describe('licenseStore', () => {
test('is true for Licensed status', () => {
useLicenseStore.getState().setStatus({ tag: 'Licensed', license: { license_id: 'x', tier: 'pro', customer_email: 'a@b.com', expires_at: 9999999999, features: [], issued_at: 1, max_activations: 1 } });
expect(useLicenseStore.getState().canEdit).toBe(true);
+ expect(useLicenseStore.getState().canUseAI).toBe(false);
+ });
+
+ test('is true for Licensed Business status', () => {
+ useLicenseStore.getState().setStatus({ tag: 'Licensed', license: { license_id: 'x', tier: 'business', customer_email: 'a@b.com', expires_at: 9999999999, features: [], issued_at: 1, max_activations: 5 } });
+ expect(useLicenseStore.getState().canEdit).toBe(true);
expect(useLicenseStore.getState().canUseAI).toBe(true);
});
@@ -119,7 +125,7 @@ describe('licenseStore', () => {
expect(result).toBe(true);
expect(useLicenseStore.getState().status?.tag).toBe('Licensed');
expect(useLicenseStore.getState().canEdit).toBe(true);
- expect(useLicenseStore.getState().canUseAI).toBe(true);
+ expect(useLicenseStore.getState().canUseAI).toBe(false);
});
test('returns false on invalid key', async () => {
@@ -168,7 +174,7 @@ describe('licenseStore', () => {
test('handles API error', async () => {
mockElectronAPI({ deactivateLicense: vi.fn().mockRejectedValue(new Error('fail')) });
- useLicenseStore.setState({ status: { tag: 'Licensed', license: {} as any }, canEdit: true, canUseAI: true });
+ useLicenseStore.setState({ status: { tag: 'Licensed', license: { license_id: 'x', tier: 'pro', customer_email: 'a@b.com', expires_at: 9999999999, features: [], issued_at: 1, max_activations: 1 } }, canEdit: true, canUseAI: false });
await useLicenseStore.getState().deactivateLicense();
expect(useLicenseStore.getState().status?.tag).toBe('Expired');
expect(useLicenseStore.getState().canEdit).toBe(false);
diff --git a/frontend/src/store/licenseStore.ts b/frontend/src/store/licenseStore.ts
index bf599ad..c665a37 100644
--- a/frontend/src/store/licenseStore.ts
+++ b/frontend/src/store/licenseStore.ts
@@ -48,7 +48,7 @@ export const useLicenseStore = create()(
setStatus: (status) => {
const canEdit = status?.tag === 'Licensed' || status?.tag === 'Trial';
- const canUseAI = status?.tag === 'Licensed';
+ const canUseAI = status?.tag === 'Licensed' && status.license.tier === 'business';
set({ status, isLoaded: true, canEdit, canUseAI });
},
@@ -58,7 +58,7 @@ export const useLicenseStore = create()(
try {
const status = await window.electronAPI?.getAppStatus();
const canEdit = status?.tag === 'Licensed' || status?.tag === 'Trial';
- const canUseAI = status?.tag === 'Licensed';
+ const canUseAI = status?.tag === 'Licensed' && status.license.tier === 'business';
set({ status: status || { tag: 'Expired' }, isLoaded: true, canEdit, canUseAI });
} catch {
set({ status: { tag: 'Expired' }, isLoaded: true, canEdit: false, canUseAI: false });
@@ -69,7 +69,7 @@ export const useLicenseStore = create()(
try {
const license = await window.electronAPI?.activateLicense(key);
if (!license) return false;
- set({ status: { tag: 'Licensed', license }, showDialog: false, canEdit: true, canUseAI: true });
+ set({ status: { tag: 'Licensed', license }, showDialog: false, canEdit: true, canUseAI: license.tier === 'business' });
return true;
} catch {
return false;
@@ -81,7 +81,7 @@ export const useLicenseStore = create()(
await window.electronAPI?.deactivateLicense();
const s = await window.electronAPI?.getAppStatus();
const canEdit = s?.tag === 'Licensed' || s?.tag === 'Trial';
- const canUseAI = s?.tag === 'Licensed';
+ const canUseAI = s?.tag === 'Licensed' && s.license.tier === 'business';
set({ status: s || { tag: 'Expired' }, isLoaded: true, canEdit, canUseAI });
} catch {
set({ status: { tag: 'Expired' }, isLoaded: true, canEdit: false, canUseAI: false });