mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
moved listener to componentDidMount
This commit is contained in:
parent
8a865c41e6
commit
4d46ed32ea
@ -106,17 +106,6 @@ class App extends React.Component {
|
||||
// append var to #root
|
||||
document.getElementById("root").classList.add("electron")
|
||||
}
|
||||
|
||||
if (this.publicMethods.isAppCapacitor()) {
|
||||
// prevent back button to close app
|
||||
CapacitorApp.addListener('backButton', ({ canGoBack }) => {
|
||||
if (!canGoBack) {
|
||||
CapacitorApp.exitApp();
|
||||
} else {
|
||||
window.history.back();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
static publicEvents = {
|
||||
@ -431,6 +420,14 @@ class App extends React.Component {
|
||||
|
||||
StatusBar.setOverlaysWebView({ overlay: true })
|
||||
//window.app.hideStatusBar()
|
||||
|
||||
CapacitorApp.addListener('backButton', ({ canGoBack }) => {
|
||||
if (!canGoBack) {
|
||||
CapacitorApp.exitApp();
|
||||
} else {
|
||||
window.history.back();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const userAgentPlatform = window.navigator.userAgent.toLowerCase()
|
||||
|
Loading…
x
Reference in New Issue
Block a user