/* Metro module 15310; source: modules/themes/native/useNativeThemeUpdater.tsx; dependencies: [31, 1310, 1357, 15311, 15312, 2] */ import ThemeStore from '../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */ import MobileVisualRefreshExperiment from '../experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as UpdateVisualRefreshModule from './updateVisualRefresh.tsx'; /* Metro dependency 15311 */ import * as UpdateThemeModule from './updateTheme.tsx'; /* Metro dependency 15312 */ function _fun117049(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15507:6, offset: 0x024a1908, size: 137 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/themes/native/useNativeThemeUpdater.tsx'); exports.default = useNativeThemeUpdater; function useNativeThemeUpdater() { // fn#117050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15507:207, offset: 0x024a1991, size: 122 bytes, params: 1, frame: 15 const value2 = (MobileVisualRefreshExperiment)('useNativeThemeUpdater'); const env0_1 = ReactModule.useRef(ThemeStore.theme); ReactModule.useLayoutEffect(_fun117051, [value2]); ReactModule.useLayoutEffect(function() { var closure = _fun117053; var env0_0 = closure; var moduleValue = require(dependencyMap[4]); var themeStoreBinding = ThemeStore; moduleValue.updateTheme(themeStoreBinding.theme); themeStoreBinding.addChangeListener(closure); return _fun117054; }, []); function _fun117051() { // fn#117051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15507:318, offset: 0x024a1a0b, size: 45 bytes, params: 1, frame: 12 const value = environment.__proto__; (UpdateVisualRefreshModule).updateVisualRefresh(env0_0); } function _fun117052() { // fn#117052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15507:380, offset: 0x024a1a38, size: 79 bytes, params: 1, frame: 14 const handleThemeUpdate2 = handleThemeUpdate; const updateTheme = UpdateThemeModule.updateTheme; const themeStoreBinding = ThemeStore; Reflect.apply(updateTheme, UpdateThemeModule, [themeStoreBinding.theme]); themeStoreBinding.addChangeListener(handleThemeUpdate2); return function() { ThemeStore.removeChangeListener(handleThemeUpdate); }; function handleThemeUpdate() { // fn#117053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15507:385, offset: 0x024a1a87, size: 76 bytes, params: 1, frame: 12 const value = environment.__proto__.__proto__; const theme = ThemeStore.theme; if (theme !== env1_1.current) { env1_1.current = theme; (require(15312) /* metro dependency 15312: updateTheme */).updateTheme(theme); } } function _fun117054() { // fn#117054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15507:555, offset: 0x024a1ad3, size: 29 bytes, params: 1, frame: 11 const themeStoreBinding = ThemeStore; themeStoreBinding.removeChangeListener(handleThemeUpdate); } } } } global.__d(_fun117049, 15310, [31, 1310, 1357, 15311, 15312, 2]) /* metro module 15310, dependencies: [31, 1310, 1357, 15311, 15312, 2] */;