mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2025-01-09 14:12:05 -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 () {
|
handleTelemetryModalOptIn () {
|
||||||
ipcRenderer.send('setTelemetryDidOptIn', true);
|
ipcRenderer.send('setTelemetryDidOptIn', true);
|
||||||
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
handleTelemetryModalOptOut () {
|
handleTelemetryModalOptOut () {
|
||||||
ipcRenderer.send('setTelemetryDidOptIn', false);
|
ipcRenderer.send('setTelemetryDidOptIn', false);
|
||||||
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
handleUpdateProjectTitle (newTitle) {
|
handleUpdateProjectTitle (newTitle) {
|
||||||
this.setState({projectTitle: newTitle});
|
this.setState({projectTitle: newTitle});
|
||||||
}
|
}
|
||||||
render () {
|
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));
|
const childProps = omit(this.props, Object.keys(ScratchDesktopComponent.propTypes));
|
||||||
|
|
||||||
|
@ -116,6 +119,7 @@ const ScratchDesktopHOC = function (WrappedComponent) {
|
||||||
canModifyCloudData={false}
|
canModifyCloudData={false}
|
||||||
canSave={false}
|
canSave={false}
|
||||||
isScratchDesktop
|
isScratchDesktop
|
||||||
|
isTelemetryEnabled={currentTelemetryState}
|
||||||
showTelemetryModal={shouldShowTelemetryModal}
|
showTelemetryModal={shouldShowTelemetryModal}
|
||||||
onClickAbout={[
|
onClickAbout={[
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue