Skip to content

Commit

Permalink
Merge pull request #116 from solaoi/main
Browse files Browse the repository at this point in the history
release
  • Loading branch information
solaoi authored Apr 4, 2024
2 parents 1b2a154 + bc740e3 commit cc4a797
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
"windows": [
{
"fullscreen": false,
"height": 600,
"width": 1024,
"height": 768,
"resizable": true,
"title": "Lycoris",
"width": 800
"title": "Lycoris"
}
]
}
Expand Down
9 changes: 7 additions & 2 deletions src/components/organisms/NoteMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ const NoteMain = (): JSX.Element => {
}, [selectedNote]);
useEffect(() => {
if (recordingNote === selectedNote!.note_id) {
bottomRef.current?.scrollIntoView({ behavior: 'smooth' });
const rect = bottomRef.current?.getBoundingClientRect();
if (rect) {
const isInViewport = rect.top >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) + 144; // 144(24px * 6 lines) is the margin of long note
if (isInViewport) {
bottomRef.current?.scrollIntoView({ behavior: 'smooth' });
}
}
}
}, [histories, recordingNote]);
useEffect(() => {
Expand All @@ -65,7 +71,6 @@ const NoteMain = (): JSX.Element => {
const unlistenPartialText = listen('partialTextRecognized', event => {
if (recordingNote === selectedNote!.note_id) {
const payload = event.payload as { content: string, is_desktop: boolean }
console.log(`is_desktop: ${payload.is_desktop}`)
if (payload.is_desktop) {
setPartialTextDesktop(payload.content)
} else {
Expand Down

0 comments on commit cc4a797

Please sign in to comment.