Skip to content

Commit 1dc1d87

Browse files
committed
v2.4.3
1 parent 861260e commit 1dc1d87

7 files changed

Lines changed: 94 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
Changelogs for development versions are located in their corresponding branch.
44

5+
## 2.4.3
6+
7+
#### Released 2020-05-18
8+
9+
### Features
10+
11+
- New, experimental privacy-respecting analytics
12+
- New hover effect on buttons and cards
13+
14+
### Changed
15+
16+
- Small UI improvements
17+
518
## 2.4.2
619

720
#### Released 2020-05-11

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import FSU from './util/fsu';
2121
import dropdownArrow from './component/customdropdown/img/arrow.png';
2222
import theemeraldtreeLogo from './page/settings/img/theemeraldtree-logo.png';
2323
import checkmark from './component/checkbox/checkmark.png';
24+
import Analytics from './util/analytics';
2425

2526
const logger = logInit('index');
2627

@@ -112,6 +113,8 @@ async function load() {
112113
Global.scanProfiles();
113114

114115
ProfilesManager.updateReloadListeners();
116+
117+
Analytics.send('launch');
115118
}
116119
} catch (e) {
117120
logger.error('Something went wrong[1]');

src/manager/settingsManager.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import path from 'path';
44
import { remote } from 'electron';
55
import LauncherManager from './launcherManager';
66
import logInit from '../util/logger';
7+
import ToastManager from './toastManager';
8+
import Global from '../util/global';
79

810
const logger = logInit('SettingsManager');
911

@@ -68,6 +70,13 @@ const SettingsManager = {
6870
this.currentSettings.mcAccount = Object.keys(LauncherManager.getMCAccounts())[0];
6971
}
7072

73+
if (this.currentSettings.analyticsEnabled === undefined && fs.existsSync(Global.PROFILES_PATH)) {
74+
logger.info('Showing analytics message');
75+
this.currentSettings.analyticsEnabled = true;
76+
ToastManager.createToast('Analytics', 'Minecraft Manager 2.4.3 includes new privacy-respecting analytics. If you want to turn them off, go to Settings');
77+
this.save();
78+
}
79+
7180
logger.info('Finished loading settings');
7281
resolve();
7382
});

src/page/settings/pages/general.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ export default function General() {
184184
<Checkbox checked={SettingsManager.currentSettings.checkToastNews} lighter onClick={checkToastNewsClick} />
185185
<Detail>check for news on startup</Detail>
186186
</InputContainer>
187+
<InputContainer>
188+
<Checkbox checked={SettingsManager.currentSettings.analyticsEnabled} lighter onClick={() => toggleSetting('analyticsEnabled')} />
189+
<Detail>enable anonymous, privacy-respecting analytics</Detail>
190+
</InputContainer>
187191
<InputContainer>
188192
<Checkbox checked={SettingsManager.currentSettings.closeOnLaunch} lighter onClick={closeOnLaunchClick} />
189193
<Detail>close minecraft manager on profile launch</Detail>

src/page/welcome/welcome.jsx

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import NavContext from '../../navContext';
1717
import tipShare from './img/tip-share.png';
1818
import tipRightClick from './img/tip-right-click.png';
1919
import LauncherManager from '../../manager/launcherManager';
20+
import InputContainer from '../editprofile/components/inputcontainer';
21+
import Checkbox from '../../component/checkbox/checkbox';
22+
import Detail from '../../component/detail/detail';
23+
import Analytics from '../../util/analytics';
2024

2125
const { dialog } = require('electron').remote;
2226

@@ -118,6 +122,7 @@ function WelcomePage({ history }) {
118122
const [mcExe, setMCExe] = useState(Global.getDefaultMCExePath());
119123
const [step, setStep] = useState(0);
120124
const [preparing, setPreparing] = useState(false);
125+
const [analyticsEnabled, setAnalyticsEnabled] = useState(true);
121126

122127
useEffect(() => {
123128
nav.header.setTitle('welcome');
@@ -146,7 +151,12 @@ function WelcomePage({ history }) {
146151
SettingsManager.setMCExe(mcExe);
147152

148153
SettingsManager.currentSettings.mcAccount = Object.keys(LauncherManager.getMCAccounts())[0];
154+
SettingsManager.currentSettings.analyticsEnabled = analyticsEnabled;
155+
SettingsManager.currentSettings.lastVersion = Global.MCM_VERSION;
149156
SettingsManager.save();
157+
158+
if (analyticsEnabled) Analytics.send('first-install');
159+
150160
const mcl = path.join(LibrariesManager.getLibrariesPath(), '/minecraftmanager');
151161
if (!fs.existsSync(mcl)) {
152162
fs.mkdirSync(mcl);
@@ -188,6 +198,10 @@ function WelcomePage({ history }) {
188198
}
189199
};
190200

201+
const analyticsClick = () => {
202+
setAnalyticsEnabled(!analyticsEnabled);
203+
}
204+
191205
return (
192206
<>
193207
<Content>
@@ -283,6 +297,27 @@ function WelcomePage({ history }) {
283297
)}
284298

285299
{step === 4 && (
300+
<>
301+
<Spacing />
302+
<Title>Analytics</Title>
303+
304+
<p>
305+
Minecraft Manager contains anonymous, privacy-respecting analytics. <br />
306+
Would you like these to be enabled?
307+
</p>
308+
309+
<InputContainer>
310+
<Checkbox lighter checked={analyticsEnabled} onClick={analyticsClick} />
311+
<Detail>Enable Analytics</Detail>
312+
</InputContainer>
313+
314+
<GB onClick={nextStep} color="green">
315+
continue
316+
</GB>
317+
</>
318+
)}
319+
320+
{step === 5 && (
286321
<>
287322
<Spacing />
288323
<Title>You're all set!</Title>
@@ -300,7 +335,7 @@ function WelcomePage({ history }) {
300335
</>
301336
)}
302337

303-
{step === 5 && (
338+
{step === 6 && (
304339
<>
305340
<Spacing />
306341
<Title>tips and tricks</Title>
@@ -318,7 +353,7 @@ function WelcomePage({ history }) {
318353
</>
319354
)}
320355

321-
{step === 6 && (
356+
{step === 7 && (
322357
<>
323358
<Spacing />
324359
<Title>tips and tricks</Title>

src/util/analytics.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import HTTPRequest from '../host/httprequest';
2+
import SettingsManager from '../manager/settingsManager';
3+
import logInit from './logger';
4+
5+
// Privacy-respecting Analytics
6+
// https://github.com/theemeraldtree/analytics
7+
8+
const logger = logInit('Analytics');
9+
10+
const Analytics = {
11+
send: (type) => {
12+
try {
13+
if (SettingsManager.currentSettings.analyticsEnabled) {
14+
logger.info(`Sending ${type} analytic`);
15+
HTTPRequest.get(`https://github.com/theemeraldtree/analytics/releases/download/minecraftmanager/${type}`);
16+
}
17+
} catch (e) {
18+
logger.error(`Unable to send ${type} analytic`);
19+
logger.error(e);
20+
}
21+
}
22+
};
23+
24+
export default Analytics;

src/util/global.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import OMAFFileAsset from '../type/omafFileAsset';
1212
import FileScanner from './fileScanner';
1313
import World from '../type/world';
1414
import logInit from './logger';
15+
import Analytics from './analytics';
1516

1617
const semver = require('semver');
1718
const { remote } = require('electron');
@@ -36,8 +37,8 @@ const Global = {
3637
versions: {}
3738
},
3839

39-
MCM_VERSION: '2.4.3-work',
40-
MCM_RELEASE_DATE: 'WIP',
40+
MCM_VERSION: '2.4.3',
41+
MCM_RELEASE_DATE: '5/18/2020',
4142

4243
OMAF_VERSION: '1.0.0',
4344

@@ -95,6 +96,7 @@ const Global = {
9596
checkChangelog() {
9697
const version = SettingsManager.currentSettings.lastVersion;
9798
if (!version || (semver.gt(this.MCM_VERSION, version) && this.MCM_VERSION.indexOf('beta') === -1)) {
99+
Analytics.send('update');
98100
ToastManager.createToast(
99101
`Welcome to ${this.MCM_VERSION}`,
100102
`<a href="https://github.com/theemeraldtree/minecraft-manager/blob/v${this.MCM_VERSION}/CHANGELOG.md">View the changelog here</a>`

0 commit comments

Comments
 (0)