61 lines
3.8 KiB
TypeScript
61 lines
3.8 KiB
TypeScript
/* Metro module 11680; source: modules/app_launcher/utils/useLaunchingActivityButtonState.tsx; dependencies: [31, 1378, 8065, 6777, 566, 8045, 6266, 2] */
|
|
import EmbeddedActivitiesStore from '../../activities/EmbeddedActivitiesStore.tsx'; /* Metro dependency 1378 */
|
|
import UsePrevious from '../../../hooks/usePrevious.tsx'; /* Metro dependency 6266 */
|
|
import FramesStore from '../../frames/FramesStore.tsx'; /* Metro dependency 8065 */
|
|
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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as UseGetOrFetchApplicationsModule from '../../applications/useGetOrFetchApplications.tsx'; /* Metro dependency 6777 */
|
|
|
|
function _fun89526(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11866:6, offset: 0x02012385, size: 153 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/app_launcher/utils/useLaunchingActivityButtonState.tsx');
|
|
exports.default = useLaunchingActivityButtonState;
|
|
function useLaunchingActivityButtonState({applicationId, context, launchingComponentId, onSubmissionComplete}) { // fn#89527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11866:232, offset: 0x0201241e, size: 332 bytes, params: 2, frame: 22
|
|
var r2;
|
|
var r3;
|
|
var moduleValue4;
|
|
const value2 = (UseGetOrFetchApplicationsModule).useGetOrFetchApplication(applicationId);
|
|
let useStateFromStores = FluxModule.useStateFromStores;
|
|
const launchState = Reflect.apply(useStateFromStores, FluxModule, [[EmbeddedActivitiesStore], function() {
|
|
return EmbeddedActivitiesStore.getLaunchState(applicationId,
|
|
context.type !== 'channel' ? undefined : context.channel.id);
|
|
}]);
|
|
useStateFromStores = FluxModule.useStateFromStores;
|
|
if (value2 == null) {
|
|
r2 = launchState != null && launchState.isLaunching;
|
|
r2 = r2 && launchState.componentId === launchingComponentId;
|
|
r3 = r2;
|
|
} else {
|
|
moduleValue4 = require(8045) /* metro dependency 8045: canLaunchFrame */;
|
|
if (moduleValue4.canLaunchFrame(value2)) {
|
|
r3 = Reflect.apply(useStateFromStores, FluxModule, [[FramesStore], function() {
|
|
return FramesStore.isLaunchingFrame(applicationId);
|
|
}]);
|
|
} else {
|
|
r2 = launchState != null && launchState.isLaunching;
|
|
r2 = r2 && launchState.componentId === launchingComponentId;
|
|
r3 = r2;
|
|
}
|
|
}
|
|
const env0_3 = r3;
|
|
const value7 = (UsePrevious)(r3);
|
|
env0_3.useEffect(_fun89530, [r3, value7, onSubmissionComplete]);
|
|
return {submitting: r3, wasSubmitting: value7 ?? null};
|
|
function _fun89530() { // fn#89530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11866:665, offset: 0x020125c4, size: 44 bytes, params: 1, frame: 10
|
|
if (!env0_3 && env0_4) {
|
|
if (onSubmissionComplete != null) {
|
|
onSubmissionComplete();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun89526, 11680, [31, 1378, 8065, 6777, 566, 8045, 6266,
|
|
2]) /* metro module 11680, dependencies: [31, 1378, 8065, 6777, 566, 8045, 6266, 2] */;
|