mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-22 21:52:31 -05:00
keep telemetry modal state in sync with main process
This commit is contained in:
parent
afb29bfdef
commit
d56a3c5810
1 changed files with 5 additions and 1 deletions
|
@ -99,15 +99,18 @@ const ScratchDesktopHOC = function (WrappedComponent) {
|
|||
}
|
||||
handleTelemetryModalOptIn () {
|
||||
ipcRenderer.send('setTelemetryDidOptIn', true);
|
||||
this.forceUpdate();
|
||||
}
|
||||
handleTelemetryModalOptOut () {
|
||||
ipcRenderer.send('setTelemetryDidOptIn', false);
|
||||
this.forceUpdate();
|
||||
}
|
||||
handleUpdateProjectTitle (newTitle) {
|
||||
this.setState({projectTitle: newTitle});
|
||||
}
|
||||
render () {
|
||||
const shouldShowTelemetryModal = (typeof ipcRenderer.sendSync('getTelemetryDidOptIn') !== 'boolean');
|
||||
const currentTelemetryState = ipcRenderer.sendSync('getTelemetryDidOptIn');
|
||||
const shouldShowTelemetryModal = (typeof currentTelemetryState !== 'boolean');
|
||||
|
||||
const childProps = omit(this.props, Object.keys(ScratchDesktopComponent.propTypes));
|
||||
|
||||
|
@ -116,6 +119,7 @@ const ScratchDesktopHOC = function (WrappedComponent) {
|
|||
canModifyCloudData={false}
|
||||
canSave={false}
|
||||
isScratchDesktop
|
||||
isTelemetryEnabled={currentTelemetryState}
|
||||
showTelemetryModal={shouldShowTelemetryModal}
|
||||
onClickAbout={[
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue