Task fully working except collaborative to handoff switching handling
This commit is contained in:
@@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { NOTES_COLLECTION } from "@/lib/constants";
|
||||
import { FilterBar } from "./FilterBar";
|
||||
import { normalizeNoteKey } from "@/lib/tags";
|
||||
|
||||
export const NotesSidebar: Component<{
|
||||
selectedNoteId: string | null;
|
||||
@@ -170,12 +171,15 @@ export const NotesSidebar: Component<{
|
||||
const handleCreateNote = async () => {
|
||||
if (!currentUserId) return;
|
||||
try {
|
||||
const keyBase = normalizeNoteKey("new-note");
|
||||
const result = await pb.collection(NOTES_COLLECTION).create({
|
||||
title: "New Note",
|
||||
key: `${keyBase}-${Date.now()}`,
|
||||
content: "",
|
||||
tags: [],
|
||||
isPrivate: false,
|
||||
user: currentUserId,
|
||||
tasks: []
|
||||
});
|
||||
props.setSelectedNoteId(result.id);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user