1- import { action , observable , computed , runInAction } from 'mobx' ;
1+ import { action , computed , observable , runInAction } from 'mobx' ;
22import BigNumber from 'bignumber.js' ;
3- import { includes , camelCase } from 'lodash' ;
4- import axios from 'axios' ;
5- import { v4 as uuidv4 } from 'uuid' ;
3+ import { camelCase , includes } from 'lodash' ;
64import { toJS } from '../../../common/utils/helper' ;
75import Store from './lib/Store' ;
86import Request from './lib/LocalizedRequest' ;
@@ -15,32 +13,32 @@ import { logger } from '../utils/logging';
1513import { setStateSnapshotLogChannel } from '../ipc/setStateSnapshotLogChannel' ;
1614import { getDesktopDirectoryPathChannel } from '../ipc/getDesktopDirectoryPathChannel' ;
1715import { getSystemLocaleChannel } from '../ipc/getSystemLocaleChannel' ;
16+ import type { Locale } from '../../../common/types/locales.types' ;
1817import { LOCALES } from '../../../common/types/locales.types' ;
1918import {
2019 compressLogsChannel ,
2120 downloadLogsChannel ,
2221 getLogsChannel ,
2322} from '../ipc/logs.ipc' ;
24- import type { LogFiles , CompressedLogStatus } from '../types/LogTypes' ;
23+ import type { CompressedLogStatus , LogFiles } from '../types/LogTypes' ;
2524import type { StateSnapshotLogParams } from '../../../common/types/logging.types' ;
26- import type { Locale } from '../../../common/types/locales.types' ;
2725import {
2826 DEFAULT_NUMBER_FORMAT ,
2927 NUMBER_FORMATS ,
3028} from '../../../common/types/number.types' ;
3129import {
30+ getRequestKeys ,
3231 hasLoadedRequest ,
3332 isRequestSet ,
3433 requestGetter ,
3534 requestGetterLocale ,
36- getRequestKeys ,
3735} from '../utils/storesUtils' ;
3836import {
39- NUMBER_OPTIONS ,
4037 DATE_ENGLISH_OPTIONS ,
4138 DATE_JAPANESE_OPTIONS ,
42- TIME_OPTIONS ,
39+ NUMBER_OPTIONS ,
4340 PROFILE_SETTINGS ,
41+ TIME_OPTIONS ,
4442} from '../config/profileConfig' ;
4543import { buildSystemInfo } from '../utils/buildSystemInfo' ;
4644import { AnalyticsAcceptanceStatus } from '../analytics/types' ;
@@ -398,6 +396,12 @@ export default class ProfileStore extends Store {
398396 _setAnalyticsAcceptanceStatus = ( status : AnalyticsAcceptanceStatus ) => {
399397 this . setAnalyticsAcceptanceRequest . execute ( status ) ;
400398 this . getAnalyticsAcceptanceRequest . execute ( ) ;
399+
400+ if ( status === AnalyticsAcceptanceStatus . ACCEPTED ) {
401+ this . analytics . enableTracking ( ) ;
402+ } else if ( status === AnalyticsAcceptanceStatus . REJECTED ) {
403+ this . analytics . disableTracking ( ) ;
404+ }
401405 } ;
402406 _getAnalyticsAcceptance = ( ) => {
403407 this . getAnalyticsAcceptanceRequest . execute ( ) ;
0 commit comments