mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-22 11:25:56 +00:00
Self-update in the background (install on close), module configs created from .dist, quiet-logging + table fixups in clean-base, backlog notes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2d0bfd0a38
commit
a6ae4e78a3
15 files changed
+358
-55
No files matched your search
+24
-1
@@ -4,10 +4,12 @@ import { Welcome } from "@/screens/Welcome";
|
||||
import { ImportServer } from "@/screens/ImportServer";
|
||||
import { Shell } from "@/screens/Shell";
|
||||
import { InstallServer } from "@/screens/InstallServer";
|
||||
import { UpdateBanner } from "@/components/UpdateBanner";
|
||||
import { autoUpdateEnabled, installOnClose, lookForUpdate } from "@/lib/selfUpdate";
|
||||
|
||||
type View = "welcome" | "add" | "import" | "install";
|
||||
|
||||
export default function App() {
|
||||
function Main() {
|
||||
const [servers, setServers] = useState<ServerSummary[] | null>(null);
|
||||
const [view, setView] = useState<View>("welcome");
|
||||
const [activeId, setActiveId] = useState<string | null>(null);
|
||||
@@ -75,3 +77,24 @@ export default function App() {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
// Quietly fetch a new Manager version a few seconds after start and install it when the window is closed.
|
||||
useEffect(() => {
|
||||
const stop = installOnClose();
|
||||
const timer = setTimeout(() => {
|
||||
if (autoUpdateEnabled()) void lookForUpdate({ download: true });
|
||||
}, 5000);
|
||||
return () => {
|
||||
clearTimeout(timer);
|
||||
stop();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Main />
|
||||
<UpdateBanner />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user