Ready to implement sync thread logic
This commit is contained in:
13
matrixgw_frontend/src/api/MatrixSyncApi.ts
Normal file
13
matrixgw_frontend/src/api/MatrixSyncApi.ts
Normal 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",
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user