mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 10:39:00 +01:00
chore(react/settings): solve type errors
This commit is contained in:
parent
1f479b20be
commit
cbc9fb7d08
@ -94,7 +94,8 @@ function AvailableActionsList() {
|
||||
<td>{ actionGroup.title }:</td>
|
||||
{actionGroup.actions.map(({ actionName, actionTitle }) =>
|
||||
<Button
|
||||
small text={actionTitle}
|
||||
size="small"
|
||||
text={actionTitle}
|
||||
onClick={() => bulk_action.addAction("_bulkAction", actionName)}
|
||||
/>
|
||||
)}
|
||||
|
||||
@ -57,7 +57,8 @@ function RecentChangesDialogComponent() {
|
||||
header={
|
||||
<Button
|
||||
text={t("recent_changes.erase_notes_button")}
|
||||
small style={{ padding: "0 10px" }}
|
||||
size="small"
|
||||
style={{ padding: "0 10px" }}
|
||||
onClick={() => {
|
||||
server.post("notes/erase-deleted-notes-now").then(() => {
|
||||
setNeedsRefresh(true);
|
||||
|
||||
@ -55,7 +55,7 @@ function RevisionsDialogComponent() {
|
||||
helpPageId="vZWERwf8U3nx"
|
||||
bodyStyle={{ display: "flex", height: "80vh" }}
|
||||
header={
|
||||
(!!revisions?.length && <Button text={t("revisions.delete_all_revisions")} small style={{ padding: "0 10px" }}
|
||||
(!!revisions?.length && <Button text={t("revisions.delete_all_revisions")} size="small" style={{ padding: "0 10px" }}
|
||||
onClick={async () => {
|
||||
const text = t("revisions.confirm_delete_all");
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import type { InputHTMLAttributes, RefObject } from "preact/compat";
|
||||
|
||||
interface FormTextBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "value"> {
|
||||
interface FormTextBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange" | "onBlur" | "value"> {
|
||||
id?: string;
|
||||
currentValue?: string;
|
||||
onChange?(newValue: string, validity: ValidityState): void;
|
||||
|
||||
@ -27,7 +27,7 @@ export default function ShortcutSettings() {
|
||||
return;
|
||||
}
|
||||
|
||||
let updatedShortcuts: KeyboardShortcut[] = null;
|
||||
let updatedShortcuts: (KeyboardShortcut[] | null) = null;
|
||||
|
||||
for (const optionName of optionNames) {
|
||||
if (!(optionName.startsWith("keyboardShortcuts"))) {
|
||||
@ -58,12 +58,13 @@ export default function ShortcutSettings() {
|
||||
|
||||
const optionsToSet: Record<string, string> = {};
|
||||
for (const keyboardShortcut of keyboardShortcuts) {
|
||||
if (!("effectiveShortcuts" in keyboardShortcut)) {
|
||||
if (!("effectiveShortcuts" in keyboardShortcut) || !keyboardShortcut.effectiveShortcuts) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!arrayEqual(keyboardShortcut.effectiveShortcuts, keyboardShortcut.defaultShortcuts)) {
|
||||
optionsToSet[getOptionName(keyboardShortcut.actionName)] = JSON.stringify(keyboardShortcut.defaultShortcuts);
|
||||
const defaultShortcuts = keyboardShortcut.defaultShortcuts ?? [];
|
||||
if (!arrayEqual(keyboardShortcut.effectiveShortcuts, defaultShortcuts)) {
|
||||
optionsToSet[getOptionName(keyboardShortcut.actionName)] = JSON.stringify(defaultShortcuts);
|
||||
}
|
||||
}
|
||||
options.saveMany(optionsToSet);
|
||||
|
||||
@ -83,7 +83,7 @@ export function SyncTest() {
|
||||
onClick={async () => {
|
||||
const result = await server.post<SyncTestResponse>("sync/test");
|
||||
|
||||
if (result.success) {
|
||||
if (result.success && result.message) {
|
||||
toast.showMessage(result.message);
|
||||
} else {
|
||||
toast.showError(t("sync_2.handshake_failed", { message: result.message }));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user