fix(react/dialogs): some type errors

This commit is contained in:
Elian Doran
2025-08-06 18:38:52 +03:00
parent edd18b53d0
commit bde270b73f
12 changed files with 75 additions and 28 deletions

View File

@@ -8,6 +8,7 @@ import { useEffect, useRef, useState } from "preact/hooks";
import note_autocomplete, { Suggestion } from "../../services/note_autocomplete";
import appContext from "../../components/app_context";
import commandRegistry from "../../services/command_registry";
import { refToJQuerySelector } from "../react/react_utils";
const KEEP_LAST_SEARCH_FOR_X_SECONDS = 120;
@@ -37,7 +38,7 @@ function JumpToNoteDialogComponent({ mode }: JumpToNoteDialogProps) {
}
function onShown() {
const $autoComplete = $(autocompleteRef.current);
const $autoComplete = refToJQuerySelector(autocompleteRef);
switch (mode) {
case "last-search":
// Fall-through if there is no text, in order to display the recent notes.
@@ -85,7 +86,7 @@ function JumpToNoteDialogComponent({ mode }: JumpToNoteDialogProps) {
export default class JumpToNoteDialog extends ReactBasicWidget {
private lastOpenedTs: number;
private lastOpenedTs?: number;
private props: JumpToNoteDialogProps = {
mode: "last-search"
};