diff --git a/src/app/connect/connection-list.tsx b/src/app/connect/connection-list.tsx index 546c39b0..abf98d14 100644 --- a/src/app/connect/connection-list.tsx +++ b/src/app/connect/connection-list.tsx @@ -164,6 +164,7 @@ export default function ConnectionList({ if (showAddConnection) { return ( setShowAddConnection(false)} onSaveComplete={onSaveComplete} /> diff --git a/src/app/connect/saved-connection.tsx b/src/app/connect/saved-connection.tsx index 35f11e15..68def16e 100644 --- a/src/app/connect/saved-connection.tsx +++ b/src/app/connect/saved-connection.tsx @@ -11,18 +11,25 @@ import { } from "@/app/connect/saved-connection-storage"; import SavedConnectionConfig from "./saved-connection-config"; import { createDatabase } from "@/lib/api/fetch-databases"; +import { User } from "lucia"; type SaveConnectionStep = "storage" | "config"; export default function SaveConnection({ + user, onSaveComplete, onClose, }: Readonly<{ + user: User | null; onSaveComplete: (storageType: SavedConnectionItem) => void; onClose: () => void; }>) { - const [storage, setStorage] = useState(); - const [step, setStep] = useState("storage"); + const [storage, setStorage] = useState( + user ? undefined : "local" + ); + const [step, setStep] = useState( + user ? "storage" : "config" + ); const [loading, setLoading] = useState(false); const onConnectionTypeSelected = useCallback( diff --git a/src/lib/encryption-edge.ts b/src/lib/encryption-edge.ts index c6fadf97..08a60fe3 100644 --- a/src/lib/encryption-edge.ts +++ b/src/lib/encryption-edge.ts @@ -7,7 +7,7 @@ function base64ToArrayBuffer(base64: string) { for (let i = 0; i < binaryString.length; i++) { bytes[i] = binaryString.charCodeAt(i); } - return bytes.buffer; + return bytes; } function arrayBufferToBase64(buffer: Uint8Array) {