Files
discord-decomp/modules/collectibles/CollectiblesShopStore.tsx
T
2026-11-01 12:12:55 +02:00

104 lines
2.7 KiB
TypeScript

// Metro module 5815 (f5816).
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let initialProductSkuId2;
let c3628_1 = [];
const analyticsLocations2 = c3628_1;
let analyticsSource2 = null;
let c3628_4 = {};
let c3628_5 = new Set();
let c3628_6 = {};
class CollectiblesShopStore extends Module589.Store {
static displayName = "CollectiblesShopStore";
get analyticsLocations() {
return analyticsLocations2;
}
get analyticsSource() {
return analyticsSource2;
}
get initialProductSkuId() {
return initialProductSkuId2;
}
getAnalytics() {
return {
analyticsLocations: analyticsLocations2,
analyticsSource: analyticsSource2
};
}
getLayout(a0) {
const r1 = a0 == null;
let r2 = null;
if (!r1) {
let r6 = c3628_4[a0];
if (r6 == null) {
r6 = null;
}
r2 = r6;
}
return r2;
}
isFetchingLayout(a0) {
return a0 != null && c3628_5.has(a0);
}
getLayoutFetchError(a0) {
const r1 = a0 == null;
let r2 = null;
if (!r1) {
let r6 = c3628_6[a0];
if (r6 == null) {
r6 = null;
}
r2 = r6;
}
return r2;
}
}
const collectiblesShopStore = new CollectiblesShopStore(Dispatcher, {
COLLECTIBLES_SHOP_OPEN: function handleOpen(a0) {
let analyticsLocations3 = a0.analyticsLocations;
if (analyticsLocations3 == null) {
analyticsLocations3 = c3628_1;
}
analyticsLocations2 = analyticsLocations3;
let analyticsSource3 = a0.analyticsSource;
if (analyticsSource3 == null) {
analyticsSource3 = null;
}
analyticsSource2 = analyticsSource3;
initialProductSkuId2 = a0.initialProductSkuId;
},
COLLECTIBLES_SHOP_CLOSE: function handleClose() {
analyticsLocations2 = c3628_1;
analyticsSource2 = null;
initialProductSkuId2 = void 0;
},
COLLECTIBLES_PRODUCT_DETAILS_OPEN: function handleProductDetailsOpen(a0) {
if (a0.skuId === initialProductSkuId2) {
initialProductSkuId2 = void 0;
}
},
COLLECTIBLES_SHOP_TAB_LAYOUT_FETCH: function handleShopTabLayoutFetch(a0) {
c3628_5.add(a0.tab);
},
COLLECTIBLES_SHOP_TAB_LAYOUT_FETCH_SUCCESS: function handleShopTabLayoutFetchSuccess(a0) {
const tab = a0.tab;
c3628_4[tab] = a0.layoutId;
delete c3628_6[tab];
c3628_5.delete(tab);
},
COLLECTIBLES_SHOP_TAB_LAYOUT_FETCH_FAILURE: function handleShopTabLayoutFetchFailure(a0) {
const tab = a0.tab;
c3628_6[tab] = a0.apiError;
c3628_5.delete(tab);
},
LOGOUT: function handleLogout() {
analyticsLocations2 = c3628_1;
analyticsSource2 = null;
initialProductSkuId2 = void 0;
c3628_4 = {};
c3628_5 = new Set();
c3628_6 = {};
}
});
export default collectiblesShopStore;