mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-08 20:25:19 +02:00
start at /dashboard, focus cursor after clipboard text
This commit is contained in:
parent
91ad36027d
commit
4a5a28805d
2 changed files with 9 additions and 2 deletions
|
|
@ -33,7 +33,7 @@ export function createMainWindow(): BrowserWindow {
|
|||
mainWindow?.show();
|
||||
});
|
||||
|
||||
mainWindow.loadURL(`http://localhost:${getServerPort()}/login`);
|
||||
mainWindow.loadURL(`http://localhost:${getServerPort()}/dashboard`);
|
||||
|
||||
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
if (url.startsWith('http://localhost')) {
|
||||
|
|
|
|||
|
|
@ -119,9 +119,16 @@ export const InlineMentionEditor = forwardRef<InlineMentionEditorRef, InlineMent
|
|||
|
||||
useEffect(() => {
|
||||
if (!initialText || !editorRef.current) return;
|
||||
editorRef.current.textContent = initialText;
|
||||
editorRef.current.textContent = initialText + "\n";
|
||||
setIsEmpty(false);
|
||||
onChange?.(initialText, Array.from(mentionedDocs.values()));
|
||||
editorRef.current.focus();
|
||||
const sel = window.getSelection();
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(editorRef.current);
|
||||
range.collapse(false);
|
||||
sel?.removeAllRanges();
|
||||
sel?.addRange(range);
|
||||
}, [initialText]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
// Focus at the end of the editor
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue