Skip to content

Commit 2b6381f

Browse files
committed
fix: Fix linting errors and warnings
1 parent f526c31 commit 2b6381f

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

src/components/editor/FileUpload/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useState, useRef } from 'react';
2-
import { Upload, X, File, Download, Loader2 } from 'lucide-react';
2+
import { Upload, X, Download, Loader2 } from 'lucide-react';
33
import { Button } from '@/components/ui/button';
44
import { Progress } from '@/components/ui/progress';
55
import type { FileAttachment } from '@/types/note';

src/components/editor/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, useRef, useCallback } from 'react';
1+
import { useState, useEffect, useCallback } from 'react';
22
import {
33
Star,
44
Archive,
@@ -86,9 +86,10 @@ export default function Index({
8686
editor.commands.setTextSelection({ from, to });
8787
}
8888
} catch {
89+
// Ignore cursor restoration errors
8990
}
9091
}
91-
}, [note?.content, editor]);
92+
}, [note, editor]);
9293

9394
const handleTitleChange = useCallback(
9495
(e: React.ChangeEvent<HTMLInputElement>) => {

src/hooks/useNotes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@ export function useNotes() {
115115
}, [encryptionReady, clerkUser, loadData]);
116116

117117
useEffect(() => {
118+
const timeouts = saveTimeoutsRef.current;
118119
return () => {
119-
saveTimeoutsRef.current.forEach((timeout) => {
120+
timeouts.forEach((timeout) => {
120121
clearTimeout(timeout);
121122
});
122-
saveTimeoutsRef.current.clear();
123+
timeouts.clear();
123124
};
124125
}, []);
125126

@@ -297,7 +298,7 @@ export function useNotes() {
297298
throw new Error('Encryption not ready. Please wait a moment and try again.');
298299
}
299300

300-
const apiNote = await api.updateNote(noteId, {
301+
await api.updateNote(noteId, {
301302
title: updates.title,
302303
content: updates.content,
303304
folderId: updates.folderId,
@@ -307,7 +308,6 @@ export function useNotes() {
307308
tags: updates.tags,
308309
});
309310

310-
const updatedNote = convertApiNote(apiNote);
311311
saveTimeoutsRef.current.delete(noteId);
312312
} catch (error) {
313313
console.error('Failed to update note:', error);

src/services/fileService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class FileService {
112112
try {
113113
const response = JSON.parse(xhr.responseText);
114114
resolve(response);
115-
} catch (error) {
115+
} catch {
116116
reject(new Error('Invalid response format'));
117117
}
118118
} else if (xhr.status === 413) {

0 commit comments

Comments
 (0)