mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-22 13:42:27 -05:00
view built-in privacy policy from telemetry dialog
This commit is contained in:
parent
ca7eeb9b7a
commit
73819d8eb7
3 changed files with 16 additions and 11 deletions
|
@ -1,20 +1,10 @@
|
|||
import {ipcRenderer} from 'electron';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import {productName, version} from '../../package.json';
|
||||
|
||||
import logo from '../icon/ScratchDesktop.svg';
|
||||
import styles from './about.css';
|
||||
|
||||
// don't actually follow the link in the `href` attribute
|
||||
// instead, tell the main process to open the privacy policy window
|
||||
const showPrivacyPolicy = event => {
|
||||
if (event) {
|
||||
event.preventDefault();
|
||||
}
|
||||
ipcRenderer.send('open-privacy-policy-window');
|
||||
return false;
|
||||
};
|
||||
import showPrivacyPolicy from './showPrivacyPolicy';
|
||||
|
||||
const AboutElement = () => (
|
||||
<div className={styles.aboutBox}>
|
||||
|
|
|
@ -26,6 +26,7 @@ import {
|
|||
|
||||
import ElectronStorageHelper from '../common/ElectronStorageHelper';
|
||||
|
||||
import showPrivacyPolicy from './showPrivacyPolicy';
|
||||
import styles from './app.css';
|
||||
|
||||
const appTarget = document.getElementById('app');
|
||||
|
@ -118,6 +119,7 @@ const ScratchDesktopHOC = function (WrappedComponent) {
|
|||
showTelemetryModal={shouldShowTelemetryModal}
|
||||
onClickAbout={this.handleClickAbout}
|
||||
onProjectTelemetryEvent={this.handleProjectTelemetryEvent}
|
||||
onShowPrivacyPolicy={showPrivacyPolicy}
|
||||
onStorageInit={this.handleStorageInit}
|
||||
onTelemetryModalOptIn={this.handleTelemetryModalOptIn}
|
||||
onTelemetryModalOptOut={this.handleTelemetryModalOptOut}
|
||||
|
|
13
src/renderer/showPrivacyPolicy.js
Normal file
13
src/renderer/showPrivacyPolicy.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import {ipcRenderer} from 'electron';
|
||||
|
||||
const showPrivacyPolicy = event => {
|
||||
if (event) {
|
||||
// Probably a click on a link; don't actually follow the link in the `href` attribute.
|
||||
event.preventDefault();
|
||||
}
|
||||
// tell the main process to open the privacy policy window
|
||||
ipcRenderer.send('open-privacy-policy-window');
|
||||
return false;
|
||||
};
|
||||
|
||||
export default showPrivacyPolicy;
|
Loading…
Reference in a new issue