Skip to content

Commit 2848827

Browse files
authored
Merge pull request #5 from ZibanPirate/patch-1
Fixed the issue "App crashes after configure page"
2 parents 44e719a + 521bbdc commit 2848827

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

renderer/components/footer.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ export default class Footer extends React.PureComponent<FooterProps, FooterState
7070
}
7171

7272
private getMountedWebview() {
73-
const e = this.props.element;
74-
if (e === null) {
73+
// webview tag must be mounted into the Dom, even if the webview component is not null!
74+
// check if at least one webview is mounted:
75+
if (document.getElementsByTagName("webview").length >= 1) {
76+
// returns the mounted webview component or null:
77+
return this.props.element;
78+
} else {
79+
// if the webview is not mounted, then return null
7580
return null;
7681
}
77-
if (e.getWebContents() === null) {
78-
// Note: When <webview> is not mounted in DOM, it returns null.
79-
return null;
80-
}
81-
return e;
8282
}
8383

8484
private goBack(e: React.MouseEvent<HTMLDivElement>) {

0 commit comments

Comments
 (0)