diff --git a/inlang/source-code/fink2/src/components/VariantHistoryList.tsx b/inlang/source-code/fink2/src/components/VariantHistoryList.tsx index e9f76396c4..21a9ca43f4 100644 --- a/inlang/source-code/fink2/src/components/VariantHistoryList.tsx +++ b/inlang/source-code/fink2/src/components/VariantHistoryList.tsx @@ -42,7 +42,7 @@ const VariantHistoryList = (props: { setLoading(undefined); props.setHistoryModalOpen(false); props.setSelectedVariantId(null); - }, 2000); + }, 1000); } }; @@ -51,7 +51,7 @@ const VariantHistoryList = (props: { getChanges(); const interval = setInterval(async () => { await getChanges(); - }, 2000); + }, 1000); return () => clearInterval(interval); }, [project]); diff --git a/inlang/source-code/fink2/src/layout.tsx b/inlang/source-code/fink2/src/layout.tsx index ba303e0e9d..0cd206fd8e 100644 --- a/inlang/source-code/fink2/src/layout.tsx +++ b/inlang/source-code/fink2/src/layout.tsx @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { useAtom } from "jotai"; -import { selectedProjectPathAtom, withPollingAtom } from "./state.ts"; +import { projectAtom, selectedProjectPathAtom, withPollingAtom } from "./state.ts"; import { useEffect, useMemo, useState } from "react"; import SlDialog from "@shoelace-style/shoelace/dist/react/dialog/index.js"; import { newProject } from "@inlang/sdk2"; @@ -19,7 +19,7 @@ export default function Layout(props: { children: React.ReactNode }) { useEffect(() => { const interval = setInterval(() => { setWithPolling(Date.now()); - }, 2000); + }, 1000); return () => clearInterval(interval); }); @@ -42,7 +42,6 @@ const MenuBar = () => {
-
@@ -71,7 +70,7 @@ const SelectProject = () => { return ( <> { > setFileName(e.target.value)} + onInput={(e: any) => setFileName(e.target.value ? e.target.value + ".inlang" : "")} > { }; const SettingsButton = () => { - // check if window.location.pathname === "/settings" + const [project] = useAtom(projectAtom); return ( - + Settings diff --git a/inlang/source-code/fink2/src/routes/changes/Page.tsx b/inlang/source-code/fink2/src/routes/changes/Page.tsx index 2d9b610855..3ff9c29cf5 100644 --- a/inlang/source-code/fink2/src/routes/changes/Page.tsx +++ b/inlang/source-code/fink2/src/routes/changes/Page.tsx @@ -6,7 +6,7 @@ import { } from "../../state.ts"; import { atom, useAtom } from "jotai"; import Layout from "../../layout.tsx"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { SlButton, SlDialog, @@ -44,9 +44,15 @@ export default function App() { userId: commitAuthor, description: commitDescription, }); - setShowDialog(false); }; + useEffect(() => { + // close dialog after commit + if (pendingChanges.length === 0) { + setShowDialog(false); + } + }) + const getScopedChangesByBundle = (bundle: BundleNested) => { const pendingChangesForBundle = pendingChanges.filter((change) => { const variantId = change.value?.id; @@ -72,6 +78,7 @@ export default function App() { { setShowDialog(true); }} diff --git a/inlang/source-code/fink2/src/routes/settings/Page.tsx b/inlang/source-code/fink2/src/routes/settings/Page.tsx index 5f37a2fe48..2851903147 100644 --- a/inlang/source-code/fink2/src/routes/settings/Page.tsx +++ b/inlang/source-code/fink2/src/routes/settings/Page.tsx @@ -17,7 +17,7 @@ export default function App() { // TODO not working why? setSettings(settings); } - }, 3000); + }, 2000); }, [project]); return ( diff --git a/inlang/source-code/fink2/src/state.ts b/inlang/source-code/fink2/src/state.ts index b29d761d1e..bd9435e12a 100644 --- a/inlang/source-code/fink2/src/state.ts +++ b/inlang/source-code/fink2/src/state.ts @@ -26,7 +26,7 @@ export const projectAtom = atom(async (get) => { const file = await project.toBlob(); await writable.write(file); await writable.close(); - }, 2000); + }, 1000); return project; } catch (e) { console.error(e);