87 lines
3.1 KiB
TypeScript
87 lines
3.1 KiB
TypeScript
// Module ID: 10548
|
|
// Function ID: 10549
|
|
// Name: useHandleUseNow
|
|
// Dependencies: [19, 10549, 4800, 5039, 4693, 4528, 1115, 10550, 9226, 2]
|
|
// Exports: useHandleUseNow
|
|
|
|
// Module 10548 (useHandleUseNow)
|
|
import RootNavigationRef from "RootNavigationRef" /* 4693 */;
|
|
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4800 */;
|
|
import ModalActionCreatorsDefault from "ModalActionCreators" /* 5039 */;
|
|
import MainTabsConstants from "MainTabsConstants" /* 10549 */;
|
|
import react from "react" /* 19 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const RootNavigatorScreen = MainTabsConstants.RootNavigatorScreen;
|
|
const result = size.fileFinishedImporting("modules/collectibles/native/useHandleUseNow.tsx");
|
|
|
|
export const useHandleUseNow = function useHandleUseNow(product) {
|
|
let canUseNow;
|
|
let isApplying;
|
|
let items2;
|
|
product = product.product;
|
|
require = product;
|
|
const stageCollectibleChangeForEditProfile = product.stageCollectibleChangeForEditProfile;
|
|
let onSuccess;
|
|
const items = [onSuccess, stageCollectibleChangeForEditProfile];
|
|
const analyticsLocations = product.analyticsLocations;
|
|
onSuccess = onSuccess.useCallback(() => {
|
|
if (null == onSuccess) {
|
|
const obj = ActionSheetActionCreatorsDefault;
|
|
obj.hideAllActionSheets();
|
|
const obj2 = ModalActionCreatorsDefault;
|
|
obj2.popAll();
|
|
if (null == stageCollectibleChangeForEditProfile) {
|
|
const obj3 = RootNavigationRef;
|
|
const rootNavigationRef = obj3.getRootNavigationRef();
|
|
const tmp9 = null != rootNavigationRef && rootNavigationRef.isReady();
|
|
if (tmp9) {
|
|
rootNavigationRef.navigate(RootNavigatorScreen.YOU);
|
|
}
|
|
}
|
|
} else {
|
|
tmp();
|
|
}
|
|
}, items);
|
|
const callback1 = onSuccess.useCallback(() => {
|
|
let intl;
|
|
const obj = { key: "collectible shop apply error", content: intl.string(require("intl").t.CKsXk3) };
|
|
const open = onSuccess(stageCollectibleChangeForEditProfile[5]).open;
|
|
onSuccess(stageCollectibleChangeForEditProfile[5]);
|
|
intl = require("intl").intl;
|
|
open(obj);
|
|
}, []);
|
|
let obj = require("hooks/useHandleUseNow");
|
|
const handleUseNow1 = obj.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(require);
|
|
callback();
|
|
} else {
|
|
handleUseNow();
|
|
}
|
|
}, items1);
|
|
const tmp5 = onSuccess(stageCollectibleChangeForEditProfile[8])({ analyticsLocations });
|
|
let closure_5 = tmp5;
|
|
let obj2 = {
|
|
handleUseNow: callback2,
|
|
isApplying,
|
|
canUseNow,
|
|
handleEditProfile: onSuccess.useCallback(() => {
|
|
closure_5();
|
|
if (null == onSuccess) {
|
|
const obj = ActionSheetActionCreatorsDefault;
|
|
obj.hideAllActionSheets();
|
|
const obj2 = ModalActionCreatorsDefault;
|
|
obj2.popAll();
|
|
} else {
|
|
tmp2();
|
|
}
|
|
}, items2)
|
|
};
|
|
items2 = [tmp5, onSuccess];
|
|
return obj2;
|
|
};
|