fix(fe/state_mgr): auto refresh is not applied
This commit is contained in:
parent
1314171a09
commit
ecb35e2de1
1 changed files with 13 additions and 0 deletions
|
@ -14,6 +14,7 @@ import { UsersClient } from "../client/users";
|
|||
import { SettingsClient } from "../client/settings";
|
||||
import { IUsersClient, IFilesClient, ISettingsClient } from "../client";
|
||||
import { loadingCtrl, ctrlOn, ctrlOff } from "../common/controls";
|
||||
import { CronTable } from "../common/cron";
|
||||
|
||||
export interface Props {}
|
||||
export interface State extends ICoreState {}
|
||||
|
@ -33,6 +34,18 @@ export class StateMgr extends React.Component<Props, State, {}> {
|
|||
this.initUpdater(this.state, query); // don't await
|
||||
}
|
||||
|
||||
componentDidMount(): void {
|
||||
CronTable().setInterval("refreshState", {
|
||||
func: this.update,
|
||||
args: [updater().updateAll],
|
||||
delay: 1000,
|
||||
});
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
CronTable().clearInterval("refreshState");
|
||||
}
|
||||
|
||||
setUsersClient = (client: IUsersClient) => {
|
||||
this.usersClient = client;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue