Files
discord-decomp/sources/modules/quests/native/BountiesModal/useBountiesRecapScroll.tsx
T
2026-07-27 16:20:00 +03:00

70 lines
3.6 KiB
TypeScript

/* Metro module 13520; source: modules/quests/native/BountiesModal/useBountiesRecapScroll.tsx; dependencies: [31, 2] */
function _fun102760(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13710:6, offset: 0x02247b91, size: 152 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importAll(31) /* metro dependency 31 */;
object = {code: 'function getRevealProgress_useBountiesRecapScrollTsx1(scrollOffset,startOffset,revealHeight){if(revealHeight<=0){return 0;}return(scrollOffset-startOffset)/revealHeight;}'};
const value = _fun102761();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/BountiesModal/useBountiesRecapScroll.tsx');
exports.RECAP_SNAP_EPSILON = 2;
exports.getRevealProgress = value;
exports.useBountiesRecapScroll = useBountiesRecapScroll;
}
function _fun102761() { // fn#102761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13710:290, offset: 0x02247c29, size: 48 bytes, params: 1, frame: 2
const closure = function(a0, a1, a2) {
var value = 0;
return a2 <= value ? value : (a0 - a1) / a2;
};
closure.__closure = {};
closure.__workletHash = 9769647749947;
closure.__initData = env0_1;
return closure;
}
function useBountiesRecapScroll({listRef, enabled, offsets}) { // fn#102763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13710:664, offset: 0x02247c75, size: 217 bytes, params: 2, frame: 18
const binding = listRef;
let useCallback = binding.useCallback;
let value = Reflect.apply(useCallback, binding, [function(a0) {
if (listRef.current != null) {
listRef.current.scrollToOffset({offset: a0, animated: true});
}
}, [listRef]]);
const value2 = binding.useCallback(_fun102765, [offsets.lastBounty, value]);
value = binding.useCallback(_fun102766, [enabled, offsets.fullRecap, offsets.lastBounty, offsets.revealHeight,
value]);
useCallback = binding.useCallback;
return {scrollToLastBounty: value2, handleRecapMomentumEnd: Reflect.apply(useCallback, binding, [_fun102767,
[enabled, value]])};
}
function _fun102765() { // fn#102765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13710:844, offset: 0x02247d89, size: 26 bytes, params: 1, frame: 11
env0_3(offsets.lastBounty);
}
function _fun102766(a0) { // fn#102766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13710:902, offset: 0x02247da3, size: 138 bytes, params: 2, frame: 16
var r1;
var offsetsBinding;
var value2;
var binding;
if (enabled) {
if (!(a0 <= offsets.lastBounty)) {
value2 = environment.__proto__;
binding = env1_2;
offsetsBinding = offsets;
r1 = binding(a0, offsetsBinding.lastBounty,
offsetsBinding.revealHeight) >= 0.25 ? offsets.fullRecap : offsets.lastBounty;
if (!(global.Math.abs(a0 - r1) < 2)) {
env0_3(r1);
}
}
}
}
function _fun102767(a0) { // fn#102767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13710:1139, offset: 0x02247e2d, size: 39 bytes, params: 2, frame: 11
if (enabled) {
env0_4(a0.contentOffset.y);
}
}