an-anime-game-launcher/src/ts/analytics.ts
Observer KRypt0n_ 013c3dce47
1.5.4
- added verification for MangoHud and shaders when you want to select them
  if they even exist in your system
- now statistics also shows amount of minutes
- fixed some possible issue with patching process
- all classes now are exported as default
- improved some inner functions
2021-11-16 20:20:24 +02:00

35 lines
1.3 KiB
TypeScript

const { ipcRenderer } = require('electron');
import $ from 'cash-dom';
import LauncherLib from './lib/LauncherLib';
import LauncherUI from './lib/LauncherUI';
$(() => {
LauncherUI.updateLang(LauncherLib.getConfig('lang.launcher'));
$('#participate').on('click', async () => {
await fetch(`https://an-anime-game-launcher.000webhostapp.com${ !$('#share-country').hasClass('checkbox-active') ? '/?hide-geo' : '' }`);
// LauncherLib.version can break this property
// because analytics can be displayed even with the first
// launcher's run and then of course uninstalled game's version
// will be "null", which in analytics means that user don't
// want to see this dialog anymore
LauncherLib.updateConfig('analytics', (await LauncherLib.getData()).game.latest.version);
ipcRenderer.invoke('hide-analytics-participation');
});
$('#skip').on('click', async () => {
LauncherLib.updateConfig('analytics', (await LauncherLib.getData()).game.latest.version);
ipcRenderer.invoke('hide-analytics-participation');
});
$('#skip-and-ignore').on('click', () => {
LauncherLib.updateConfig('analytics', null);
ipcRenderer.invoke('hide-analytics-participation');
});
});