Make TOTPView load data right away.
This commit is contained in:
parent
8f2e91bf6b
commit
331d8c9e81
|
@ -17,12 +17,16 @@ export class RefreshingTOTPGridItem extends Component<{ baseMount: string; totpK
|
||||||
}
|
}
|
||||||
timer: unknown;
|
timer: unknown;
|
||||||
|
|
||||||
|
updateTOTPCode(): void {
|
||||||
|
getTOTPCode(this.props.baseMount, this.props.totpKey).then((code) => {
|
||||||
|
this.setState({ totpValue: code });
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
|
this.updateTOTPCode();
|
||||||
this.timer = setInterval(() => {
|
this.timer = setInterval(() => {
|
||||||
getTOTPCode(this.props.baseMount, this.props.totpKey).then((code) => {
|
this.updateTOTPCode();
|
||||||
this.setState({ totpValue: code });
|
|
||||||
})
|
|
||||||
this.setState({});
|
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +66,6 @@ export class TOTPViewPage extends Page {
|
||||||
<br />
|
<br />
|
||||||
<div id="totpList">
|
<div id="totpList">
|
||||||
{await (async () => {
|
{await (async () => {
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const elem = await Promise.all(Array.from(await getTOTPKeys(this.state.baseMount)).map(async (key) =>
|
const elem = await Promise.all(Array.from(await getTOTPKeys(this.state.baseMount)).map(async (key) =>
|
||||||
<RefreshingTOTPGridItem
|
<RefreshingTOTPGridItem
|
||||||
|
|
Loading…
Reference in a new issue