Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/invisal/libsql-studio in…
Browse files Browse the repository at this point in the history
…to develop
  • Loading branch information
invisal committed Mar 20, 2024
2 parents 31d00d8 + 0782660 commit 72ec87f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/app/connect/connection-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export default function ConnectionList({
if (showAddConnection) {
return (
<SaveConnection
user={user}
onClose={() => setShowAddConnection(false)}
onSaveComplete={onSaveComplete}
/>
Expand Down
11 changes: 9 additions & 2 deletions src/app/connect/saved-connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<SavedConnectionStorage>();
const [step, setStep] = useState<SaveConnectionStep>("storage");
const [storage, setStorage] = useState<SavedConnectionStorage | undefined>(
user ? undefined : "local"
);
const [step, setStep] = useState<SaveConnectionStep>(
user ? "storage" : "config"
);
const [loading, setLoading] = useState(false);

const onConnectionTypeSelected = useCallback(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/encryption-edge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 72ec87f

Please sign in to comment.