diff options
| author | MaheshtheDev <[email protected]> | 2025-10-03 07:56:41 +0000 |
|---|---|---|
| committer | MaheshtheDev <[email protected]> | 2025-10-03 07:56:41 +0000 |
| commit | c3f1647a70c905b2022158dcd9be6d585c846056 (patch) | |
| tree | 6d8cfd3d5a35ed36959593cfb029f70021b508ae /apps/web | |
| parent | ui: update the chrome extension visibilty (#448) (diff) | |
| download | supermemory-c3f1647a70c905b2022158dcd9be6d585c846056.tar.xz supermemory-c3f1647a70c905b2022158dcd9be6d585c846056.zip | |
fix: raycast org selection based api key creation (#447)
Diffstat (limited to 'apps/web')
| -rw-r--r-- | apps/web/components/views/integrations.tsx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/web/components/views/integrations.tsx b/apps/web/components/views/integrations.tsx index 00d9ab60..5a6d09d0 100644 --- a/apps/web/components/views/integrations.tsx +++ b/apps/web/components/views/integrations.tsx @@ -259,6 +259,10 @@ export function IntegrationsView() { const createRaycastApiKeyMutation = useMutation({ mutationFn: async () => { + if (!org?.id) { + throw new Error("Organization ID is required") + } + const res = await authClient.apiKey.create({ metadata: { organizationId: org?.id, @@ -287,12 +291,13 @@ export function IntegrationsView() { if ( qParam === "raycast" && !hasTriggeredRaycast && - !createRaycastApiKeyMutation.isPending + !createRaycastApiKeyMutation.isPending && + org?.id ) { setHasTriggeredRaycast(true) createRaycastApiKeyMutation.mutate() } - }, [searchParams, hasTriggeredRaycast, createRaycastApiKeyMutation]) + }, [searchParams, hasTriggeredRaycast, createRaycastApiKeyMutation, org]) const handleShortcutClick = (shortcutType: "add" | "search") => { setSelectedShortcutType(shortcutType) |