67 lines
3.5 KiB
TypeScript
67 lines
3.5 KiB
TypeScript
/* Metro module 15799; source: modules/parent_tools/hooks/useConnectGuardianGate.tsx; dependencies: [57, 31, 5116, 566, 5118, 4594, 2] */
|
|
function _fun121387(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16007:6, offset: 0x02546e15, size: 153 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const familyCenterStore = importDefault(5116) /* metro dependency 5116: FamilyCenterStore */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/parent_tools/hooks/useConnectGuardianGate.tsx');
|
|
exports.useConnectGuardianGate = useConnectGuardianGate;
|
|
}
|
|
|
|
function useConnectGuardianGate() { // fn#121388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16007:238, offset: 0x02546eae, size: 289 bytes, params: 1, frame: 23
|
|
const {linkCode,
|
|
expiresAt} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([FamilyCenterStore],
|
|
function() {
|
|
var object = {};
|
|
object.linkCode = FamilyCenterStore.getLinkCode();
|
|
object.expiresAt = FamilyCenterStore.getLinkCodeExpiresAt();
|
|
return object;
|
|
});
|
|
const binding = env0_4;
|
|
let useState = binding.useState;
|
|
const value3 = Reflect.apply(useState, binding, [false]);
|
|
const binding2 = env0_3;
|
|
const value4 = binding2(value3, 2);
|
|
const property = value4[0];
|
|
const env0_0 = value4[1];
|
|
useState = binding.useState;
|
|
const value5 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property2 = value5[0];
|
|
const env0_1 = value5[1];
|
|
const env0_2 = binding.useRef(0);
|
|
const value6 = binding.useCallback(_fun121390, []);
|
|
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(value6);
|
|
return property ? {state: 'error'} : property2 ? linkCode == null ? {state: 'error'} : expiresAt != null ? {state: 'gate',
|
|
linkCode: linkCode, expiresAt: expiresAt, refresh: value6} : {state: 'error'} : {state: 'loading'};
|
|
}
|
|
|
|
function _fun121390() { // fn#121390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16007:524, offset: 0x02546ffa, size: 110 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const binding = env0_2;
|
|
const current = binding.current;
|
|
const value2 = typeof current === 'bigint' ? current + 1n : +current + 1;
|
|
binding.current = value2;
|
|
value2(false);
|
|
let value = environment.__proto__;
|
|
value = require(5118) /* metro dependency 5118: FamilyCenterActionCreators */;
|
|
value = value.getLinkCodeForCurrentUser();
|
|
value = value.then(_fun121391);
|
|
value.catch(_fun121392);
|
|
}
|
|
|
|
function _fun121391() { // fn#121391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16007:595, offset: 0x02547068, size: 51 bytes, params: 1, frame: 12
|
|
if (env0_0 === env1_2.current) {
|
|
env1_0(false);
|
|
env1_1(true);
|
|
}
|
|
}
|
|
|
|
function _fun121392() { // fn#121392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16007:639, offset: 0x0254709b, size: 40 bytes, params: 1, frame: 11
|
|
if (env0_0 === env1_2.current) {
|
|
env1_0(true);
|
|
}
|
|
}
|
|
|