1
0
Fork 0

Make TOTPView load data right away.

This commit is contained in:
Kitteh 2021-05-22 13:40:12 +01:00
parent 8f2e91bf6b
commit 331d8c9e81

View file

@ -17,12 +17,16 @@ export class RefreshingTOTPGridItem extends Component<{ baseMount: string; totpK
}
timer: unknown;
componentDidMount(): void {
this.timer = setInterval(() => {
updateTOTPCode(): void {
getTOTPCode(this.props.baseMount, this.props.totpKey).then((code) => {
this.setState({ totpValue: code });
})
this.setState({});
}
componentDidMount(): void {
this.updateTOTPCode();
this.timer = setInterval(() => {
this.updateTOTPCode();
}, 3000);
}
@ -62,8 +66,6 @@ export class TOTPViewPage extends Page {
<br />
<div id="totpList">
{await (async () => {
try {
const elem = await Promise.all(Array.from(await getTOTPKeys(this.state.baseMount)).map(async (key) =>
<RefreshingTOTPGridItem