Skip to content

Commit 7a45f99

Browse files
committed
Cleaned up comments
1 parent 07a5f47 commit 7a45f99

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/components/DocumentEditor.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function DocumentEditor({ documentId }: DocumentEditorProps) {
5353
const editor = useEditor({
5454
extensions: [
5555
StarterKit.configure({
56-
codeBlock: false, // We'll use the lowlight version
56+
codeBlock: false,
5757
}),
5858
Placeholder.configure({
5959
placeholder: 'Start writing your document...',
@@ -70,7 +70,6 @@ export function DocumentEditor({ documentId }: DocumentEditorProps) {
7070
setHasUnsavedChanges(true);
7171
},
7272
onTransaction: () => {
73-
// Force re-render to update toolbar button states for any editor change
7473
setUpdateCounter(prev => prev + 1);
7574
},
7675
editorProps: {
@@ -85,7 +84,6 @@ export function DocumentEditor({ documentId }: DocumentEditorProps) {
8584
if (document && editor) {
8685
setTitle(document.title);
8786

88-
// Clean up empty or malformed HTML content
8987
let cleanContent = document.content;
9088
if (
9189
!cleanContent ||
@@ -101,7 +99,6 @@ export function DocumentEditor({ documentId }: DocumentEditorProps) {
10199
}
102100
}, [document, editor]);
103101

104-
// Track changes for unsaved state
105102
useEffect(() => {
106103
if (document && editor) {
107104
const currentContent = editor.getHTML();
@@ -271,7 +268,6 @@ export function DocumentEditor({ documentId }: DocumentEditorProps) {
271268
/>
272269
</div>
273270

274-
{/* Toolbar */}
275271
{editor && (
276272
<div className="flex items-center space-x-2 p-4 border-b border-gray-200 bg-gray-50">
277273
<button
@@ -375,7 +371,6 @@ export function DocumentEditor({ documentId }: DocumentEditorProps) {
375371
</div>
376372
)}
377373

378-
{/* Editor */}
379374
<div className="min-h-[400px]">
380375
<EditorContent editor={editor} />
381376
</div>

src/server/routers/documents.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ export const documentsRouter = createTRPCRouter({
151151
})
152152
)
153153
.mutation(async ({ ctx, input }) => {
154-
// Check if user owns the document or is a collaborator with edit rights
155154
const document = await ctx.prisma.document.findFirst({
156155
where: {
157156
id: input.id,
@@ -198,7 +197,6 @@ export const documentsRouter = createTRPCRouter({
198197
delete: protectedProcedure
199198
.input(z.object({ id: z.string() }))
200199
.mutation(async ({ ctx, input }) => {
201-
// Only the owner can delete a document
202200
const document = await ctx.prisma.document.findFirst({
203201
where: {
204202
id: input.id,

0 commit comments

Comments
 (0)