mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-11 03:24:16 +00:00
moved listener to componentDidMount
This commit is contained in:
parent
0273c2129f
commit
dc57ab1e34
@ -106,17 +106,6 @@ class App extends React.Component {
|
|||||||
// append var to #root
|
// append var to #root
|
||||||
document.getElementById("root").classList.add("electron")
|
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 = {
|
static publicEvents = {
|
||||||
@ -431,6 +420,14 @@ class App extends React.Component {
|
|||||||
|
|
||||||
StatusBar.setOverlaysWebView({ overlay: true })
|
StatusBar.setOverlaysWebView({ overlay: true })
|
||||||
//window.app.hideStatusBar()
|
//window.app.hideStatusBar()
|
||||||
|
|
||||||
|
CapacitorApp.addListener('backButton', ({ canGoBack }) => {
|
||||||
|
if (!canGoBack) {
|
||||||
|
CapacitorApp.exitApp();
|
||||||
|
} else {
|
||||||
|
window.history.back();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const userAgentPlatform = window.navigator.userAgent.toLowerCase()
|
const userAgentPlatform = window.navigator.userAgent.toLowerCase()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user