From e740e729c361b44c70b8f2b19d0e73cad8dae632 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Mon, 13 Apr 2026 16:03:21 +0300 Subject: [PATCH] chore(options/sync): get rid of save button --- .../src/widgets/type_widgets/options/sync.tsx | 52 ++++++++----------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/options/sync.tsx b/apps/client/src/widgets/type_widgets/options/sync.tsx index 8c0b813de8..0cb0905cf7 100644 --- a/apps/client/src/widgets/type_widgets/options/sync.tsx +++ b/apps/client/src/widgets/type_widgets/options/sync.tsx @@ -1,12 +1,11 @@ import { SyncTestResponse } from "@triliumnext/commons"; -import { useRef } from "preact/hooks"; +import { useState } from "preact/hooks"; import { t } from "../../../services/i18n"; import server from "../../../services/server"; import toast from "../../../services/toast"; -import Button from "../../react/Button"; import FormTextBox from "../../react/FormTextBox"; -import { useTriliumOptions } from "../../react/hooks"; +import { useTriliumOption } from "../../react/hooks"; import OptionsRow, { OptionsRowWithButton } from "./components/OptionsRow"; import OptionsSection from "./components/OptionsSection"; import TimeSelector from "./components/TimeSelector"; @@ -16,37 +15,30 @@ export default function SyncOptions() { } export function SyncConfiguration() { - const [ options, setOptions ] = useTriliumOptions("syncServerHost", "syncProxy"); - const syncServerHost = useRef(options.syncServerHost); - const syncProxy = useRef(options.syncProxy); + const [syncServerHost, setSyncServerHost] = useTriliumOption("syncServerHost"); + const [syncProxy, setSyncProxy] = useTriliumOption("syncProxy"); + const [localHost, setLocalHost] = useState(syncServerHost); + const [localProxy, setLocalProxy] = useState(syncProxy); return ( -
{ - setOptions({ - syncServerHost: syncServerHost.current, - syncProxy: syncProxy.current - }); - e.preventDefault(); - }}> - - syncServerHost.current = newValue} - /> - + + + - - syncProxy.current = newValue} - /> - - - -