mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
Fix bug in renderQrCodeModal()
This commit is contained in:
@ -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);
|
||||||
}}
|
}}
|
||||||
|
Reference in New Issue
Block a user