Ready to implement sync thread logic

This commit is contained in:
2025-11-18 22:17:39 +01:00
parent 5c13cffe08
commit c9b703bea3
9 changed files with 126 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
import { APIClient } from "./ApiClient";
export class MatrixSyncApi {
/**
* Force sync thread startup
*/
static async Start(): Promise<void> {
await APIClient.exec({
method: "POST",
uri: "/matrix_sync/start",
});
}
}

View File

@@ -1,3 +1,6 @@
import { APIClient } from "../api/ApiClient";
import { MatrixSyncApi } from "../api/MatrixSyncApi";
import { AsyncWidget } from "../widgets/AsyncWidget";
import { useUserInfo } from "../widgets/dashboard/BaseAuthenticatedPage";
import { NotLinkedAccountMessage } from "../widgets/NotLinkedAccountMessage";
@@ -6,5 +9,15 @@ export function HomeRoute(): React.ReactElement {
if (!user.info.matrix_user_id) return <NotLinkedAccountMessage />;
return <p>Todo home route</p>;
return (
<p>
Todo home route{" "}
<AsyncWidget
loadKey={1}
errMsg="Failed to start sync thread!"
load={MatrixSyncApi.Start}
build={() => <>sync started</>}
/>
</p>
);
}