mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-22 21:52:31 -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 React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import {productName, version} from '../../package.json';
|
import {productName, version} from '../../package.json';
|
||||||
|
|
||||||
import logo from '../icon/ScratchDesktop.svg';
|
import logo from '../icon/ScratchDesktop.svg';
|
||||||
import styles from './about.css';
|
import styles from './about.css';
|
||||||
|
import showPrivacyPolicy from './showPrivacyPolicy';
|
||||||
// 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;
|
|
||||||
};
|
|
||||||
|
|
||||||
const AboutElement = () => (
|
const AboutElement = () => (
|
||||||
<div className={styles.aboutBox}>
|
<div className={styles.aboutBox}>
|
||||||
|
|
|
@ -26,6 +26,7 @@ import {
|
||||||
|
|
||||||
import ElectronStorageHelper from '../common/ElectronStorageHelper';
|
import ElectronStorageHelper from '../common/ElectronStorageHelper';
|
||||||
|
|
||||||
|
import showPrivacyPolicy from './showPrivacyPolicy';
|
||||||
import styles from './app.css';
|
import styles from './app.css';
|
||||||
|
|
||||||
const appTarget = document.getElementById('app');
|
const appTarget = document.getElementById('app');
|
||||||
|
@ -118,6 +119,7 @@ const ScratchDesktopHOC = function (WrappedComponent) {
|
||||||
showTelemetryModal={shouldShowTelemetryModal}
|
showTelemetryModal={shouldShowTelemetryModal}
|
||||||
onClickAbout={this.handleClickAbout}
|
onClickAbout={this.handleClickAbout}
|
||||||
onProjectTelemetryEvent={this.handleProjectTelemetryEvent}
|
onProjectTelemetryEvent={this.handleProjectTelemetryEvent}
|
||||||
|
onShowPrivacyPolicy={showPrivacyPolicy}
|
||||||
onStorageInit={this.handleStorageInit}
|
onStorageInit={this.handleStorageInit}
|
||||||
onTelemetryModalOptIn={this.handleTelemetryModalOptIn}
|
onTelemetryModalOptIn={this.handleTelemetryModalOptIn}
|
||||||
onTelemetryModalOptOut={this.handleTelemetryModalOptOut}
|
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