mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 18:56:22 +00:00
modify: change the file where detect Internet disconnection
This commit is contained in:
@@ -20,9 +20,7 @@ class Main extends React.Component {
|
|||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
const isOnline = window.navigator.onLine
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production' && isOnline) {
|
|
||||||
mobileAnalytics.initAwsMobileAnalytics()
|
mobileAnalytics.initAwsMobileAnalytics()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const os = require('os')
|
|||||||
let mobileAnalyticsClient
|
let mobileAnalyticsClient
|
||||||
|
|
||||||
AWS.config.region = 'us-east-1'
|
AWS.config.region = 'us-east-1'
|
||||||
if (process.env.NODE_ENV === 'production' && ConfigManager.default.get().amaEnabled) {
|
if (process.env.NODE_ENV === 'production' && ConfigManager.default.get().amaEnabled && window.navigator.onLine) {
|
||||||
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
||||||
IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxxxxxxxxxx'
|
IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user