mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Adjust Note in Uitab && Add message notification for policy save
This commit is contained in:
@@ -4,6 +4,7 @@ import styles from './InfoTab.styl'
|
||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||
import store from 'browser/main/store'
|
||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||
import _ from 'lodash'
|
||||
|
||||
const electron = require('electron')
|
||||
const { shell, remote } = electron
|
||||
@@ -36,8 +37,21 @@ class InfoTab extends React.Component {
|
||||
|
||||
if (!newConfig.amaEnabled) {
|
||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('DISABLE_AMA')
|
||||
this.setState({
|
||||
amaMessage: 'We hope we will gain your trust'
|
||||
})
|
||||
} else {
|
||||
this.setState({
|
||||
amaMessage: 'Thank\'s for trust us'
|
||||
})
|
||||
}
|
||||
|
||||
_.debounce(() => {
|
||||
this.setState({
|
||||
amaMessage: ''
|
||||
})
|
||||
}, 3000)()
|
||||
|
||||
ConfigManager.set(newConfig)
|
||||
|
||||
store.dispatch({
|
||||
@@ -46,6 +60,11 @@ class InfoTab extends React.Component {
|
||||
})
|
||||
}
|
||||
|
||||
infoMessage () {
|
||||
const { amaMessage } = this.state
|
||||
return amaMessage ? <p styleName='policy-confirm'>{amaMessage}</p> : null
|
||||
}
|
||||
|
||||
render () {
|
||||
return (
|
||||
<div styleName='root'>
|
||||
@@ -107,6 +126,7 @@ class InfoTab extends React.Component {
|
||||
/>
|
||||
Enable to send analytics to our servers<br />
|
||||
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>Save</button>
|
||||
{this.infoMessage()}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user