Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 2c9712b

Browse files
committed
update: unloadCallback made private
1 parent e37af06 commit 2c9712b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/structures/auth/Registration.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,15 @@ export default class Registration extends React.Component<IProps, IState> {
139139

140140
componentDidMount() {
141141
this.replaceClient(this.props.serverConfig);
142+
//triggers a confirmation dialog for data loss before page unloads/refreshes
142143
window.addEventListener("beforeunload", this.unloadCallback);
143144
}
144145

145146
componentWillUnmount() {
146147
window.removeEventListener("beforeunload", this.unloadCallback);
147148
}
148149

149-
unloadCallback = (event) => {
150+
private unloadCallback = (event) => {
150151
event.preventDefault();
151152
event.returnValue = "";
152153
return "";

0 commit comments

Comments
 (0)