Fix Safari issues for popups

This commit is contained in:
Chi Vinh Le
2017-08-01 20:32:49 +07:00
parent a4815ff927
commit 5b751b7ba4
+2 -2
View File
@@ -42,14 +42,14 @@ export default class Popup extends Component {
this.onUnload();
const interval = setInterval(() => {
if (this.ref.onload === null) {
if (this.ref && this.ref.onload === null) {
this.setCallbacks();
clearInterval(interval);
}
}, 50);
this.detectCloseInterval = setInterval(() => {
if (this.ref.closed) {
if (!this.ref || this.ref.closed) {
clearInterval(this.detectCloseInterval);
this.onClose();
}