Fix bug in renderQrCodeModal()

This commit is contained in:
Gucheng Wang
2022-12-16 23:09:48 +08:00
parent d668022af0
commit 1bdee13150

View File

@ -36,6 +36,10 @@ class ProductBuyPage extends React.Component {
} }
getProduct() { getProduct() {
if (this.state.productName === undefined) {
return;
}
ProductBackend.getProduct("admin", this.state.productName) ProductBackend.getProduct("admin", this.state.productName)
.then((product) => { .then((product) => {
this.setState({ this.setState({
@ -107,6 +111,10 @@ class ProductBuyPage extends React.Component {
} }
renderQrCodeModal() { renderQrCodeModal() {
if (this.state.qrCodeModalProvider === undefined || this.state.qrCodeModalProvider === null) {
return null;
}
return ( return (
<Modal title={ <Modal title={
<div> <div>
@ -114,7 +122,7 @@ class ProductBuyPage extends React.Component {
{" " + i18next.t("product:Please scan the QR code to pay")} {" " + i18next.t("product:Please scan the QR code to pay")}
</div> </div>
} }
open={this.state.qrCodeModalProvider !== null} open={this.state.qrCodeModalProvider !== undefined && this.state.qrCodeModalProvider !== null}
onOk={() => { onOk={() => {
Setting.goToLink(this.state.product.returnUrl); Setting.goToLink(this.state.product.returnUrl);
}} }}