decord/source/modules/core/native/handleAppStateChanged.tsx

53 lines
2.1 KiB
TypeScript
Raw Normal View History

// Module ID: 18012
// Function ID: 18013
2026-07-20 16:05:17 +00:00
// Name: handleAppStateChanged
// Dependencies: [502, 1895, 1074, 3, 10, 573, 4659, 18011, 7578, 4485, 9, 1242, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 18012 (handleAppStateChanged)
import LoggerDefault from "Logger" /* 3 */;
import TTITrackerDefault from "TTITracker" /* 9 */;
import AppStartPerformanceDefault from "AppStartPerformance" /* 10 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import ThemeActionCreators from "ThemeActionCreators" /* 4485 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4659 */;
import TTIAnalyticsUtils from "TTIAnalyticsUtils" /* 7578 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import AppStateStore from "AppStateStore" /* 1895 */;
2026-07-23 10:11:24 +00:00
require = fn;
const Constants = fn(1074);
({ AnalyticEvents: hasOwnProperty, AppStates: metroRequire } = Constants);
let closure_7 = new LoggerDefault("index.native.tsx");
const size = fn(2);
let result = size.fileFinishedImporting("modules/core/native/handleAppStateChanged.tsx");
2026-07-20 16:05:17 +00:00
export default function handleAppStateChanged(state) {
state = AppStateStore.getState();
AppStartPerformanceDefault.markAndLog(closure_7, "\u{1F3C3}", "AppState changing from " + state + " to " + state);
DispatcherDefault.dispatch({ type: "APP_STATE_UPDATE", state });
2026-07-29 08:29:29 +00:00
let isAuthenticatedResult = state === constants2.BACKGROUND && state === tmp6.ACTIVE;
2026-07-20 16:05:17 +00:00
if (isAuthenticatedResult) {
isAuthenticatedResult = AuthenticationStore.isAuthenticated();
2026-07-20 16:05:17 +00:00
}
if (isAuthenticatedResult) {
isAuthenticatedResult = RTCConnectionStore.default.isDisconnected();
const _default = RTCConnectionStore.default;
2026-07-20 16:05:17 +00:00
}
if (isAuthenticatedResult) {
tmp2(18011).deferUpdate();
const tmp2Result = tmp2(18011);
2026-07-20 16:05:17 +00:00
}
if (state === constants2.ACTIVE) {
TTIAnalyticsUtils.trackAppOpened("launcher");
const result = ThemeActionCreators.setSystemThemeIfNeeded();
2026-07-20 16:05:17 +00:00
}
const obj3 = { type: "APP_STATE_UPDATE", state };
const tmp8 = state === constants2.ACTIVE && state !== constants2.ACTIVE;
TTITrackerDefault.appStateChanged(state);
2026-07-29 08:29:29 +00:00
if (tmp8) {
tmp2(1242).track(constants.APP_BACKGROUND, {});
const tmp2Result4 = tmp2(1242);
2026-07-20 16:05:17 +00:00
}
};