Files
discord-decomp/sources/modules/collectibles/native/hooks/useScrollToInitialIndexOnce.tsx
T
2026-07-27 16:20:00 +03:00

31 lines
1.9 KiB
TypeScript

/* Metro module 14047; source: modules/collectibles/native/hooks/useScrollToInitialIndexOnce.tsx; dependencies: [31, 2] */
function _fun106528(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#106528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14244:6, offset: 0x022df4ca, size: 115 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importAll(31) /* metro dependency 31 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/collectibles/native/hooks/useScrollToInitialIndexOnce.tsx');
exports.INITIAL_SCROLL_DELAY_MS = 100;
exports.useScrollToInitialIndexOnce = useScrollToInitialIndexOnce;
}
function useScrollToInitialIndexOnce({initialScrollIndex, shouldScroll, flashListRef, afterMs}) { // fn#106529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14244:265, offset: 0x022df53d, size: 121 bytes, params: 2, frame: 18
const env0_0 = initialScrollIndex;
afterMs = afterMs === undefined ? 100 : afterMs;
const binding = env0_0;
const env0_4 = binding.useRef(false);
binding.useEffect(_fun106530, [shouldScroll, initialScrollIndex, afterMs, flashListRef]);
}
function _fun106530() { // fn#106530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14244:402, offset: 0x022df5b6, size: 83 bytes, params: 1, frame: 13
if (initialScrollIndex != null && shouldScroll && !env0_4.current) {
env0_4.current = true;
global.setTimeout(function() {
var current = flashListRef.current;
if (current != null) {
current.scrollToIndex({animated: true, index: initialScrollIndex});
}
}, afterMs);
}
}