43 lines
2.7 KiB
TypeScript
43 lines
2.7 KiB
TypeScript
/* Metro module 16228; source: modules/core/native/handleAppStateChanged.tsx; dependencies: [1226, 7030, 661, 3, 20, 694, 4294, 16227, 4884, 3998, 14, 683, 2] */
|
|
function _fun125480(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#125480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16436:6, offset: 0x025da14b, size: 208 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const appStateStore = importDefault(7030) /* metro dependency 7030: AppStateStore */;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_5 = value.AnalyticEvents;
|
|
const env0_6 = value.AppStates;
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('index.native.tsx');
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/core/native/handleAppStateChanged.tsx');
|
|
exports.default = handleAppStateChanged_125481;
|
|
}
|
|
|
|
function handleAppStateChanged_125481(a0) { // fn#125481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16436:284, offset: 0x025da21b, size: 435 bytes, params: 2, frame: 22
|
|
var defaultImport5;
|
|
const state = AppStateStore.getState();
|
|
const defaultImport = importDefault(20) /* metro dependency 20: AppStartPerformance */;
|
|
defaultImport.markAndLog(env0_7, '🏃', 'AppState changing from ' + state + ' to ' + a0);
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'APP_STATE_UPDATE', state: a0});
|
|
const BACKGROUND = AppStates.BACKGROUND;
|
|
let r3 = state === BACKGROUND && a0 === AppStates.ACTIVE;
|
|
let ACTIVE = AppStates.ACTIVE;
|
|
const r2 = state === ACTIVE && a0 !== AppStates.ACTIVE;
|
|
r3 = r3 && AuthenticationStore.isAuthenticated() && (require(4294) /* metro dependency 4294: RTCConnectionStore */).default.isDisconnected();
|
|
if (r3) {
|
|
(importDefault(16227) /* metro dependency 16227: BundleUpdaterActionCreators */).deferUpdate();
|
|
}
|
|
ACTIVE = AppStates.ACTIVE;
|
|
if (a0 === ACTIVE) {
|
|
(require(4884) /* metro dependency 4884: TTIAnalyticsUtils */).trackAppOpened('launcher');
|
|
(require(3998) /* metro dependency 3998: ThemeActionCreators */).setSystemThemeIfNeeded();
|
|
}
|
|
(importDefault(14) /* metro dependency 14: TTITracker */).appStateChanged(a0);
|
|
if (r2) {
|
|
defaultImport5 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport5.track(AnalyticEvents.APP_BACKGROUND, {});
|
|
}
|
|
}
|
|
|