70 lines
4.6 KiB
TypeScript
70 lines
4.6 KiB
TypeScript
/* Metro module 13406; source: modules/parent_tools/hooks/useSelectedTeenUser.tsx; dependencies: [1878, 5119, 5116, 8171, 632, 2] */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import FamilyCenterStore from '../FamilyCenterStore.tsx'; /* Metro dependency 5116 */
|
|
import FamilyCenterControlledSettingsStore from '../FamilyCenterControlledSettingsStore.tsx'; /* Metro dependency 5119 */
|
|
import UseIsInAdultAgeGroup from './useIsInAdultAgeGroup.tsx'; /* Metro dependency 8171 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as UseStateFromStoresModule from '../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
|
|
|
|
function _fun102022(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13596:6, offset: 0x0222887a, size: 176 bytes, params: 8, frame: 19
|
|
let env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/parent_tools/hooks/useSelectedTeenUser.tsx');
|
|
exports.useSelectedTeenUser = function() {
|
|
var env0_0 = importDefault(dependencyMap[3])();
|
|
return require(dependencyMap[4]).useStateFromStores([FamilyCenterStore, UserStore], _fun102024);
|
|
};
|
|
exports.useTeenUserForId = function(a0) {
|
|
var env0_0 = a0;
|
|
return require(dependencyMap[4]).useStateFromStores([UserStore], _fun102026);
|
|
};
|
|
exports.useShouldLoadSettingsForSelectedTeenUser = useShouldLoadSettingsForSelectedTeenUser;
|
|
function useSelectedTeenUser() { // fn#102023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13596:232, offset: 0x0222892a, size: 91 bytes, params: 1, frame: 15
|
|
const env0_0 = (UseIsInAdultAgeGroup)();
|
|
return (UseStateFromStoresModule).useStateFromStores([FamilyCenterStore,
|
|
UserStore], _fun102024);
|
|
function _fun102024() { // fn#102024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13596:294, offset: 0x02228985, size: 73 bytes, params: 1, frame: 12
|
|
var value;
|
|
if (env0_0 !== true) {
|
|
value = environment.__proto__;
|
|
return UserStore.getCurrentUser();
|
|
}
|
|
value = environment.__proto__;
|
|
const selectedTeenId = FamilyCenterStore.getSelectedTeenId();
|
|
return selectedTeenId === null ? undefined : UserStore.getUser(selectedTeenId);
|
|
}
|
|
|
|
}
|
|
|
|
function useTeenUserForId(a0) { // fn#102025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13596:422, offset: 0x022289ce, size: 66 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
return (UseStateFromStoresModule).useStateFromStores([UserStore], _fun102026);
|
|
function _fun102026() { // fn#102026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13596:457, offset: 0x02228a10, size: 37 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__;
|
|
value = UserStore.getUser(env0_0);
|
|
if (value != null) {
|
|
return value;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function useShouldLoadSettingsForSelectedTeenUser() { // fn#102027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13596:547, offset: 0x02228a35, size: 111 bytes, params: 1, frame: 15
|
|
const selectedTeenId = FamilyCenterStore.getSelectedTeenId();
|
|
const value = (UseStateFromStoresModule).useStateFromStoresObject([FamilyCenterControlledSettingsStore],
|
|
_fun102028);
|
|
return selectedTeenId !== null && (!value.hasLoadedSettings && !value.isLoading);
|
|
function _fun102028() { // fn#102028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13596:620, offset: 0x02228aa4, size: 67 bytes, params: 1, frame: 13
|
|
const r1 = env0_0 != null && FamilyCenterControlledSettingsStore.hasSettingsForUser(env0_0);
|
|
const value = environment.__proto__;
|
|
return {hasLoadedSettings: r1, isLoading: FamilyCenterControlledSettingsStore.isLoading};
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun102022, 13406, [1878, 5119, 5116, 8171, 632,
|
|
2]) /* metro module 13406, dependencies: [1878, 5119, 5116, 8171, 632, 2] */;
|