decord/alpha/source/modules/collectibles/native/useHandleUseNow.tsx
github-actions c6aa9eb120 chore: update source for alpha 349.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
2026-10-01 06:55:13 +00:00

71 lines
2.9 KiB
TypeScript

// Module ID: 10748
// Function ID: 10749
// Name: useHandleUseNow
// Dependencies: [19, 10749, 4809, 5048, 4722, 4557, 1115, 10750, 9419, 2]
// Exports: useHandleUseNow
// Module 10748 (useHandleUseNow)
import RootNavigationRef from "RootNavigationRef" /* 4722 */;
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4809 */;
import ModalActionCreatorsDefault from "ModalActionCreators" /* 5048 */;
import noop from "module_19" /* 19 */;
require = fn;
const RootNavigatorScreen = fn(10749).RootNavigatorScreen;
const size = fn(2);
const result = size.fileFinishedImporting("modules/collectibles/native/useHandleUseNow.tsx");
export const useHandleUseNow = function useHandleUseNow(analyticsLocations) {
const product = analyticsLocations.product;
require = product;
const stageCollectibleChangeForEditProfile = analyticsLocations.stageCollectibleChangeForEditProfile;
let onSuccess;
const items = [onSuccess, stageCollectibleChangeForEditProfile];
onSuccess = onSuccess.useCallback(() => {
if (null == onSuccess) {
ActionSheetActionCreatorsDefault.hideAllActionSheets();
ModalActionCreatorsDefault.popAll();
if (null == stageCollectibleChangeForEditProfile) {
const rootNavigationRef = RootNavigationRef.getRootNavigationRef();
if (tmp9) {
rootNavigationRef.navigate(RootNavigatorScreen.YOU);
}
tmp9 = null != rootNavigationRef && rootNavigationRef.isReady();
}
} else {
tmp();
}
}, items);
const callback1 = onSuccess.useCallback(() => {
const obj2 = { key: "collectible shop apply error", content: null };
const intl = product(stageCollectibleChangeForEditProfile[6]).intl;
obj2.content = intl.string(product(stageCollectibleChangeForEditProfile[6]).t.CKsXk3);
onSuccess(stageCollectibleChangeForEditProfile[5]).open(obj2);
}, []);
const handleUseNow1 = require("hooks/useHandleUseNow").useHandleUseNow({ product, onSuccess, onError: callback1 });
const handleUseNow = handleUseNow1.handleUseNow;
const items1 = [stageCollectibleChangeForEditProfile, product, onSuccess, handleUseNow];
({ isApplying, canUseNow } = handleUseNow1);
const callback2 = onSuccess.useCallback(() => {
if (null != stageCollectibleChangeForEditProfile) {
tmp(product);
callback();
} else {
handleUseNow();
}
}, items1);
const tmp5 = onSuccess(stageCollectibleChangeForEditProfile[8])({ analyticsLocations: analyticsLocations.analyticsLocations });
closure_5 = tmp5;
let obj2 = { handleUseNow: callback2, isApplying, canUseNow, handleEditProfile: null };
const items2 = [tmp5, onSuccess];
obj2.handleEditProfile = onSuccess.useCallback(() => {
closure_5();
if (null == onSuccess) {
ActionSheetActionCreatorsDefault.hideAllActionSheets();
ModalActionCreatorsDefault.popAll();
} else {
tmp2();
}
}, items2);
return obj2;
};