This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,51 +1,56 @@
/* Metro module 11344; source: modules/messages/native/hooks/useChannelLoading.tsx; dependencies: [57, 31, 11345, 9835, 4595, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
function _fun86737(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:6, offset: 0x01f9e2c4, size: 137 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/native/hooks/useChannelLoading.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/messages/native/hooks/useChannelLoading.tsx');
exports.default = useChannelLoading;
function useChannelLoading({channelId, jumpTargetId, oldestUnreadMessageId, shouldJumpToOriginalPost}) { // fn#86738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:211, offset: 0x01f9e34d, size: 150 bytes, params: 2, frame: 16
const property = shouldJumpToOriginalPost(ReactModule.useState(_fun86739), 1)[0];
const startOrCancelLatestMessagesLoad2 = startOrCancelLatestMessagesLoad;
(importDefault(4595) /* metro dependency 4595: useMountEffect */)(function() {
startOrCancelLatestMessagesLoad(false);
return _fun86742;
});
return {channelLatestMessageLoadingStatsManager: property,
startOrCancelLatestMessagesLoad: startOrCancelLatestMessagesLoad2};
function _fun86739() { // fn#86739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:337, offset: 0x01f9e3e3, size: 51 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(11345) /* metro dependency 11345: ChannelLatestMessageLoadingStatsManager */;
const value2 = Object.create(value.prototype, {constructor: {value: value}});
value = new value('Messages');
return value instanceof Object ? value : value2;
}
function startOrCancelLatestMessagesLoad(a0) { // fn#86740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:412, owner: useChannelLoading.startOrCancelLatestMessagesLoad, offset: 0x01f9e416, size: 95 bytes, params: 2, frame: 15
let value = environment.__proto__;
value = require(9835) /* metro dependency 9835: MessagesUtils */;
const startOrCancelChannelLatestMessagesLoad = value.startOrCancelChannelLatestMessagesLoad;
const object = {};
object.jumpTargetId = jumpTargetId;
object.oldestUnreadMessageId = oldestUnreadMessageId;
object.shouldJumpToOriginalPost = shouldJumpToOriginalPost(a0);
object.channelId = channelId;
object.tracker = ReactModule;
Reflect.apply(startOrCancelChannelLatestMessagesLoad, value, [object]);
}
function _fun86741() { // fn#86741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:574, offset: 0x01f9e475, size: 27 bytes, params: 1, frame: 11
startOrCancelLatestMessagesLoad(false);
return _fun86742;
function _fun86742() { // fn#86742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:615, offset: 0x01f9e490, size: 21 bytes, params: 1, frame: 9
env1_4.cancel();
}
}
}
}
function useChannelLoading({channelId, jumpTargetId, oldestUnreadMessageId, shouldJumpToOriginalPost}) { // fn#86738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:211, offset: 0x01f9e34d, size: 150 bytes, params: 2, frame: 16
const property = shouldJumpToOriginalPost(env0_4.useState(_fun86739), 1)[0];
const closure = startOrCancelLatestMessagesLoad;
(importDefault(4595) /* metro dependency 4595: useMountEffect */)(function() {
startOrCancelLatestMessagesLoad(false);
return _fun86742;
});
return {channelLatestMessageLoadingStatsManager: property, startOrCancelLatestMessagesLoad: closure};
}
function _fun86739() { // fn#86739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:337, offset: 0x01f9e3e3, size: 51 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(11345) /* metro dependency 11345: ChannelLatestMessageLoadingStatsManager */;
const value2 = Object.create(value.prototype, {constructor: {value: value}});
value = new value('Messages');
return value instanceof Object ? value : value2;
}
function startOrCancelLatestMessagesLoad(a0) { // fn#86740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:412, owner: useChannelLoading.startOrCancelLatestMessagesLoad, offset: 0x01f9e416, size: 95 bytes, params: 2, frame: 15
let value = environment.__proto__;
value = require(9835) /* metro dependency 9835: MessagesUtils */;
const startOrCancelChannelLatestMessagesLoad = value.startOrCancelChannelLatestMessagesLoad;
const object2 = {};
object2.jumpTargetId = jumpTargetId;
object2.oldestUnreadMessageId = oldestUnreadMessageId;
object2.shouldJumpToOriginalPost = shouldJumpToOriginalPost(a0);
object2.channelId = channelId;
object2.tracker = env0_4;
Reflect.apply(startOrCancelChannelLatestMessagesLoad, value, [object2]);
}
function _fun86741() { // fn#86741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:574, offset: 0x01f9e475, size: 27 bytes, params: 1, frame: 11
startOrCancelLatestMessagesLoad(false);
return _fun86742;
}
function _fun86742() { // fn#86742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11530:615, offset: 0x01f9e490, size: 21 bytes, params: 1, frame: 9
env1_4.cancel();
}
global.__d(_fun86737, 11344, [57, 31, 11345, 9835, 4595,
2]) /* metro module 11344, dependencies: [57, 31, 11345, 9835, 4595, 2] */;
File diff suppressed because it is too large. Load diff
@@ -1,92 +1,142 @@
/* Metro module 11346; source: modules/messages/native/hooks/useScrollHandlers.tsx; dependencies: [31, 7729, 3, 4559, 9764, 690, 9850, 9852, 6531, 2] */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as UseChatBottomManagerUIStoreModule from '../../../chat_input/native/useChatBottomManagerUIStore.tsx'; /* Metro dependency 7729 */
import * as ChatChangesetUpdateTrackerModule from '../../../chat/native/ChatChangesetUpdateTracker.tsx'; /* Metro dependency 9852 */
function _fun86749(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:6, offset: 0x01f9e6fc, size: 195 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
let value = require(7729) /* metro dependency 7729: useChatBottomManagerUIStore */;
let value = UseChatBottomManagerUIStoreModule;
const env0_4 = value.updateIsAtBottom;
const env0_5 = value.updateShouldShowJumpToPresentButton;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('useScrollHandlers');
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/messages/native/hooks/useScrollHandlers.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/messages/native/hooks/useScrollHandlers.tsx');
exports.default = useScrollHandlers;
}
function useScrollHandlers({chatRef, chatManager, chatUpdatesQueue, pendingUpdatesQueueRef, animatedRef, fetchMoreBefore, fetchMoreAfter, handleVisibleMessagesChange, applyNativeRowsUpdate, messages, channel, channelId, screenIndex, onScroll, useReducedMotion, isStaff, visibleMessagesWindowHandler}) { // fn#86750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:308, offset: 0x01f9e7bf, size: 445 bytes, params: 2, frame: 21
const binding = pendingUpdatesQueueRef;
return {hasHandledScrollRef: binding.useRef(false), isAtBottomRef: binding.useRef(false),
isNearBottomRef: binding.useRef(false), isNearTopRef: binding.useRef(false),
deceleratingRef: binding.useRef(false), draggingRef: binding.useRef(false),
firstIgnoredScrollEventTimestampRef: binding.useRef(undefined), loadMoreBefore: function() {
animatedRef.current = true;
fetchMoreBefore();
}, loadMoreAfter: function() {
animatedRef.current = true;
fetchMoreAfter();
}, scrollToTop: scrollToTop_86756, scrollToRelativeOffset: scrollToRelativeOffset_86757,
scrollToTopMessage: scrollToTopMessage_86758, updateNativeRows: updateNativeRows,
handleScrollCallbacks: handleScrollCallbacks, handleScroll: handleScroll,
handleScrollPosition: handleScrollPosition};
}
function handleScrollCallbacks({eventTimestamp, isAtBottom, isNearBottom, isNearTop, dragging, decelerating, isFirstMessageVisible}) { // fn#86753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:837, owner: useScrollHandlers.handleScrollCallbacks, offset: 0x01f9e9b2, size: 436 bytes, params: 2, frame: 26
var r10;
var r5;
var loadingMore;
var value3;
var isScreenReaderEnabled;
var defaultImport;
isNearBottom = !(isNearBottom === undefined) && isNearBottom;
isNearTop = !(isNearTop === undefined) && isNearTop;
dragging = !(dragging === undefined) && dragging;
decelerating = !(decelerating === undefined) && decelerating;
isFirstMessageVisible = !(isFirstMessageVisible === undefined) && isFirstMessageVisible;
if (channel == null) {
return false;
}
if (messages.length !== 0) {
value3 = environment.__proto__;
isScreenReaderEnabled = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).getIsScreenReaderEnabled();
loadingMore = messages.loadingMore;
if (loadingMore) {
r5 = !loadingMore;
} else {
r10 = dragging || decelerating;
r10 = !r10 ? isScreenReaderEnabled : r10;
r5 = r10;
}
r5 = r5 && pendingUpdatesQueueRef.current.length === 0;
if (env0_21.current) {
if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
function useScrollHandlers({chatRef, chatManager, chatUpdatesQueue, pendingUpdatesQueueRef, animatedRef, fetchMoreBefore, fetchMoreAfter, handleVisibleMessagesChange, applyNativeRowsUpdate, messages, channel, channelId, screenIndex, onScroll, useReducedMotion, isStaff, visibleMessagesWindowHandler}) { // fn#86750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:308, offset: 0x01f9e7bf, size: 445 bytes, params: 2, frame: 21
const binding = pendingUpdatesQueueRef;
return {hasHandledScrollRef: binding.useRef(false), isAtBottomRef: binding.useRef(false),
isNearBottomRef: binding.useRef(false), isNearTopRef: binding.useRef(false),
deceleratingRef: binding.useRef(false), draggingRef: binding.useRef(false),
firstIgnoredScrollEventTimestampRef: binding.useRef(undefined), loadMoreBefore: function() {
animatedRef.current = true;
fetchMoreBefore();
}, loadMoreAfter: function() {
animatedRef.current = true;
fetchMoreAfter();
}, scrollToTop: scrollToTop_86756, scrollToRelativeOffset: scrollToRelativeOffset_86757,
scrollToTopMessage: scrollToTopMessage_86758, updateNativeRows: updateNativeRows,
handleScrollCallbacks: handleScrollCallbacks, handleScroll: handleScroll_86754,
handleScrollPosition: handleScrollPosition_86760};
function handleScrollCallbacks({eventTimestamp, isAtBottom, isNearBottom, isNearTop, dragging, decelerating, isFirstMessageVisible}) { // fn#86753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:837, owner: useScrollHandlers.handleScrollCallbacks, offset: 0x01f9e9b2, size: 436 bytes, params: 2, frame: 26
var r10;
var r5;
var loadingMore;
var value3;
var isScreenReaderEnabled;
var defaultImport;
isNearBottom = !(isNearBottom === undefined) && isNearBottom;
isNearTop = !(isNearTop === undefined) && isNearTop;
dragging = !(dragging === undefined) && dragging;
decelerating = !(decelerating === undefined) && decelerating;
isFirstMessageVisible = !(isFirstMessageVisible === undefined) && isFirstMessageVisible;
if (channel == null) {
return false;
}
if (messages.length !== 0) {
value3 = environment.__proto__;
isScreenReaderEnabled = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).getIsScreenReaderEnabled();
loadingMore = messages.loadingMore;
if (loadingMore) {
r5 = !loadingMore;
} else {
r10 = dragging || decelerating;
r10 = !r10 ? isScreenReaderEnabled : r10;
r5 = r10;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
r5 = r5 && pendingUpdatesQueueRef.current.length === 0;
if (env0_21.current) {
if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearTop) {
if (messages.hasMoreBefore) {
if (r5) {
loadMoreBefore_86751();
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearTop) {
if (messages.hasMoreBefore) {
if (r5) {
loadMoreBefore_86751();
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
@@ -112,103 +162,103 @@ function handleScrollCallbacks({eventTimestamp, isAtBottom, isNearBottom, isNear
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
onScroll({isFirstMessageVisible: isFirstMessageVisible});
chatUpdatesQueue.tryFlush();
} else {
loadingMore = messages.loadingMore;
if (loadingMore) {
return false;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
isScreenReaderEnabled = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).getIsScreenReaderEnabled();
loadingMore = messages.loadingMore;
if (loadingMore) {
r5 = !loadingMore;
} else {
r10 = dragging || decelerating;
r10 = !r10 ? isScreenReaderEnabled : r10;
r5 = r10;
}
r5 = r5 && pendingUpdatesQueueRef.current.length === 0;
if (env0_21.current) {
if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
onScroll({isFirstMessageVisible: isFirstMessageVisible});
chatUpdatesQueue.tryFlush();
} else {
loadingMore = messages.loadingMore;
if (loadingMore) {
return false;
}
isScreenReaderEnabled = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).getIsScreenReaderEnabled();
loadingMore = messages.loadingMore;
if (loadingMore) {
r5 = !loadingMore;
} else {
r10 = dragging || decelerating;
r10 = !r10 ? isScreenReaderEnabled : r10;
r5 = r10;
}
r5 = r5 && pendingUpdatesQueueRef.current.length === 0;
if (env0_21.current) {
if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (isNearTop) {
if (messages.hasMoreBefore) {
if (r5) {
loadMoreBefore_86751();
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearTop) {
if (messages.hasMoreBefore) {
if (r5) {
loadMoreBefore_86751();
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
@@ -234,181 +284,138 @@ function handleScrollCallbacks({eventTimestamp, isAtBottom, isNearBottom, isNear
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
onScroll({isFirstMessageVisible: isFirstMessageVisible});
chatUpdatesQueue.tryFlush();
}
} else if (env0_20.current) {
if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
return true;
}
function useScrollHandlersHandleScroll({eventTimestamp, isAtBottom, isNearBottom, isNearTop, dragging, decelerating, shouldShowJumpToPresent, isFirstMessageVisible}) { // fn#86754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:1361, owner: useScrollHandlers.handleScroll, offset: 0x01f9eb66, size: 249 bytes, params: 2, frame: 21
var environment;
var value;
isNearBottom = !(isNearBottom === undefined) && isNearBottom;
isNearTop = !(isNearTop === undefined) && isNearTop;
dragging = !(dragging === undefined) && dragging;
decelerating = !(decelerating === undefined) && decelerating;
shouldShowJumpToPresent = !(shouldShowJumpToPresent === undefined) && shouldShowJumpToPresent;
isFirstMessageVisible = !(isFirstMessageVisible === undefined) && isFirstMessageVisible;
if (handleScrollCallbacks({eventTimestamp: eventTimestamp, isAtBottom: isAtBottom, isNearBottom: isNearBottom,
isNearTop: isNearTop, dragging: dragging, decelerating: decelerating,
shouldShowJumpToPresent: shouldShowJumpToPresent, isFirstMessageVisible: isFirstMessageVisible})) {
env0_19.current = isAtBottom;
env0_20.current = isNearBottom;
env0_21.current = isNearTop;
env0_23.current = dragging;
env0_22.current = decelerating;
value = environment.__proto__;
value = require(690) /* metro dependency 690: ReactBatchUpdatesNative */;
value.batchUpdates(function() {
updateShouldShowJumpToPresentButton(channelId, screenIndex,
shouldShowJumpToPresent || messages.hasMoreAfter);
updateIsAtBottom(screenIndex, isAtBottom);
});
}
} else if (isNearBottom) {
if (messages.hasMoreAfter) {
if (r5) {
loadMoreAfter_86752();
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
function useScrollHandlersScrollToTop() { // fn#86756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2020, owner: useScrollHandlers.scrollToTop, offset: 0x01f9eca2, size: 70 bytes, params: 1, frame: 16
let value = a0;
let r4 = !(value !== undefined) || value;
value = environment.__proto__;
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
const scrollToTop = value.scrollToTop;
const current = chatRef.current;
r4 = r4 && !useReducedMotion;
Reflect.apply(scrollToTop, value, [current, r4]);
}
function useScrollHandlersScrollToRelativeOffset(a0) { // fn#86757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2090, owner: useScrollHandlers.scrollToRelativeOffset, offset: 0x01f9ece8, size: 74 bytes, params: 2, frame: 17
let value = a1;
let r5 = !(value !== undefined) || value;
value = environment.__proto__;
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
const scrollToRelativeOffset = value.scrollToRelativeOffset;
const current = chatRef.current;
r5 = r5 && !useReducedMotion;
Reflect.apply(scrollToRelativeOffset, value, [current, a0, r5]);
}
function useScrollHandlersScrollToTopMessage() { // fn#86758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2171, owner: useScrollHandlers.scrollToTopMessage, offset: 0x01f9ed32, size: 90 bytes, params: 1, frame: 14
var value3;
var defaultImport;
const previousRows = chatManager.getPreviousRows();
if (previousRows.length > 0) {
value3 = environment.__proto__;
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.scrollTo(chatRef.current, previousRows.length - 1);
}
}
function updateNativeRows(a0) { // fn#86759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2271, owner: useScrollHandlers.updateNativeRows, offset: 0x01f9ed8c, size: 101 bytes, params: 2, frame: 12
if (chatUpdatesQueue.isBlocking) {
chatUpdatesQueue.add(a0);
} else if (a0.isLoadingAtTop) {
if (env0_22.current) {
chatUpdatesQueue.add(a0);
} else if (env0_23.current) {
chatUpdatesQueue.add(a0);
} else {
applyNativeRowsUpdate(a0);
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
} else {
applyNativeRowsUpdate(a0);
}
} else if (!(env0_19.current === isAtBottom && env0_18.current)) {
defaultImport = importDefault(9764) /* metro dependency 9764: DimensionActionCreators */;
defaultImport.updateChannelDimensions(channel.id, eventTimestamp, isAtBottom ? 1 : 0, 1, 0);
env0_18.current = true;
}
onScroll({isFirstMessageVisible: isFirstMessageVisible});
chatUpdatesQueue.tryFlush();
}
return true;
}
function handleScroll({eventTimestamp, isAtBottom, isNearBottom, isNearTop, dragging, decelerating, shouldShowJumpToPresent, isFirstMessageVisible}) { // fn#86754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:1361, owner: useScrollHandlers.handleScroll, offset: 0x01f9eb66, size: 249 bytes, params: 2, frame: 21
var environment;
var value;
isNearBottom = !(isNearBottom === undefined) && isNearBottom;
isNearTop = !(isNearTop === undefined) && isNearTop;
dragging = !(dragging === undefined) && dragging;
decelerating = !(decelerating === undefined) && decelerating;
shouldShowJumpToPresent = !(shouldShowJumpToPresent === undefined) && shouldShowJumpToPresent;
isFirstMessageVisible = !(isFirstMessageVisible === undefined) && isFirstMessageVisible;
if (handleScrollCallbacks({eventTimestamp: eventTimestamp, isAtBottom: isAtBottom, isNearBottom: isNearBottom,
isNearTop: isNearTop, dragging: dragging, decelerating: decelerating,
shouldShowJumpToPresent: shouldShowJumpToPresent, isFirstMessageVisible: isFirstMessageVisible})) {
env0_19.current = isAtBottom;
env0_20.current = isNearBottom;
env0_21.current = isNearTop;
env0_23.current = dragging;
env0_22.current = decelerating;
value = environment.__proto__;
value = require(690) /* metro dependency 690: ReactBatchUpdatesNative */;
value.batchUpdates(function() {
updateShouldShowJumpToPresentButton(channelId, screenIndex,
shouldShowJumpToPresent || messages.hasMoreAfter);
updateIsAtBottom(screenIndex, isAtBottom);
});
}
}
function useScrollHandlersScrollToTop() { // fn#86756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2020, owner: useScrollHandlers.scrollToTop, offset: 0x01f9eca2, size: 70 bytes, params: 1, frame: 16
let value = a0;
let r4 = !(value !== undefined) || value;
value = environment.__proto__;
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
const scrollToTop = value.scrollToTop;
const current = chatRef.current;
r4 = r4 && !useReducedMotion;
Reflect.apply(scrollToTop, value, [current, r4]);
}
function useScrollHandlersScrollToRelativeOffset(a0) { // fn#86757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2090, owner: useScrollHandlers.scrollToRelativeOffset, offset: 0x01f9ece8, size: 74 bytes, params: 2, frame: 17
let value = a1;
let r5 = !(value !== undefined) || value;
value = environment.__proto__;
value = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
const scrollToRelativeOffset = value.scrollToRelativeOffset;
const current = chatRef.current;
r5 = r5 && !useReducedMotion;
Reflect.apply(scrollToRelativeOffset, value, [current, a0, r5]);
}
function useScrollHandlersScrollToTopMessage() { // fn#86758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2171, owner: useScrollHandlers.scrollToTopMessage, offset: 0x01f9ed32, size: 90 bytes, params: 1, frame: 14
var value3;
var defaultImport;
const previousRows = chatManager.getPreviousRows();
if (previousRows.length > 0) {
value3 = environment.__proto__;
defaultImport = importDefault(9850) /* metro dependency 9850: NativeChatUtils */;
defaultImport.scrollTo(chatRef.current, previousRows.length - 1);
}
}
function updateNativeRows(a0) { // fn#86759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2271, owner: useScrollHandlers.updateNativeRows, offset: 0x01f9ed8c, size: 101 bytes, params: 2, frame: 12
if (chatUpdatesQueue.isBlocking) {
chatUpdatesQueue.add(a0);
} else if (a0.isLoadingAtTop) {
if (env0_22.current) {
chatUpdatesQueue.add(a0);
} else if (env0_23.current) {
chatUpdatesQueue.add(a0);
} else {
applyNativeRowsUpdate(a0);
function useScrollHandlersHandleScrollPosition({timeStamp, nativeEvent}) { // fn#86760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2444, owner: useScrollHandlers.handleScrollPosition, offset: 0x01f9edf1, size: 407 bytes, params: 2, frame: 32
var binding;
const isAtBottom = nativeEvent.isAtBottom;
const isNearBottom = nativeEvent.isNearBottom;
const isNearTop = nativeEvent.isNearTop;
const dragging = nativeEvent.dragging;
const decelerating = nativeEvent.decelerating;
const shouldShowJumpToPresent = nativeEvent.shouldShowJumpToPresent;
const isFirstMessageVisible = nativeEvent.isFirstMessageVisible;
const firstVisibleMessageIndex = nativeEvent.firstVisibleMessageIndex;
const firstVisibleMessagePercentVisible = nativeEvent.firstVisibleMessagePercentVisible;
const lastVisibleMessageIndex = nativeEvent.lastVisibleMessageIndex;
const changesetUpdateId = nativeEvent.changesetUpdateId;
const lastVisibleMessagePercentVisible = nativeEvent.lastVisibleMessagePercentVisible;
const changesetIdForChat = (ChatChangesetUpdateTrackerModule).getChangesetIdForChat(chatRef.current);
if (changesetUpdateId !== changesetIdForChat) {
if (env0_17.current == null) {
env0_17.current = timeStamp;
}
if (isStaff) {
binding = env1_6;
binding.log('STAFF-ACK-LOG: Ignoring outdated scroll event.', channelId, changesetUpdateId,
changesetIdForChat,
timeStamp);
}
} else {
var handleVisibleMessagesChangeBinding = handleVisibleMessagesChange;
var object = {firstVisibleMessageRowIndex: firstVisibleMessageIndex,
lastVisibleMessageRowIndex: lastVisibleMessageIndex,
firstVisibleMessagePercentVisible: firstVisibleMessagePercentVisible,
lastVisibleMessagePercentVisible: lastVisibleMessagePercentVisible};
var QuestsVisibleMessagesChangedSource = (require(6531) /* metro dependency 6531: QuestTypes */).QuestsVisibleMessagesChangedSource;
var SCROLL = QuestsVisibleMessagesChangedSource.SCROLL;
object.source = SCROLL;
handleVisibleMessagesChangeBinding(object);
var r17 = env0_17.current ?? timeStamp;
env0_17.current = undefined;
handleScroll_86754({eventTimestamp: r17, isAtBottom: isAtBottom, isNearBottom: isNearBottom,
isNearTop: isNearTop,
dragging: dragging, decelerating: decelerating, shouldShowJumpToPresent: shouldShowJumpToPresent,
isFirstMessageVisible: isFirstMessageVisible});
visibleMessagesWindowHandler.handleScrollPosition({rows: chatManager._rows,
firstVisibleMessageRowIndex: firstVisibleMessageIndex,
lastVisibleMessageRowIndex: lastVisibleMessageIndex});
}
}
} else {
applyNativeRowsUpdate(a0);
}
}
function useScrollHandlersHandleScrollPosition({timeStamp, nativeEvent}) { // fn#86760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11532:2444, owner: useScrollHandlers.handleScrollPosition, offset: 0x01f9edf1, size: 407 bytes, params: 2, frame: 32
var binding;
const isAtBottom = nativeEvent.isAtBottom;
const isNearBottom = nativeEvent.isNearBottom;
const isNearTop = nativeEvent.isNearTop;
const dragging = nativeEvent.dragging;
const decelerating = nativeEvent.decelerating;
const shouldShowJumpToPresent = nativeEvent.shouldShowJumpToPresent;
const isFirstMessageVisible = nativeEvent.isFirstMessageVisible;
const firstVisibleMessageIndex = nativeEvent.firstVisibleMessageIndex;
const firstVisibleMessagePercentVisible = nativeEvent.firstVisibleMessagePercentVisible;
const lastVisibleMessageIndex = nativeEvent.lastVisibleMessageIndex;
const changesetUpdateId = nativeEvent.changesetUpdateId;
const lastVisibleMessagePercentVisible = nativeEvent.lastVisibleMessagePercentVisible;
const changesetIdForChat = (require(9852) /* metro dependency 9852: ChatChangesetUpdateTracker */).getChangesetIdForChat(chatRef.current);
if (changesetUpdateId !== changesetIdForChat) {
if (env0_17.current == null) {
env0_17.current = timeStamp;
}
if (isStaff) {
binding = env1_6;
binding.log('STAFF-ACK-LOG: Ignoring outdated scroll event.', channelId, changesetUpdateId,
changesetIdForChat,
timeStamp);
}
} else {
var handleVisibleMessagesChangeBinding = handleVisibleMessagesChange;
var object2 = {firstVisibleMessageRowIndex: firstVisibleMessageIndex,
lastVisibleMessageRowIndex: lastVisibleMessageIndex,
firstVisibleMessagePercentVisible: firstVisibleMessagePercentVisible,
lastVisibleMessagePercentVisible: lastVisibleMessagePercentVisible};
var QuestsVisibleMessagesChangedSource = (require(6531) /* metro dependency 6531: QuestTypes */).QuestsVisibleMessagesChangedSource;
var SCROLL = QuestsVisibleMessagesChangedSource.SCROLL;
object2.source = SCROLL;
handleVisibleMessagesChangeBinding(object2);
var r17 = env0_17.current ?? timeStamp;
env0_17.current = undefined;
handleScroll({eventTimestamp: r17, isAtBottom: isAtBottom, isNearBottom: isNearBottom, isNearTop: isNearTop,
dragging: dragging, decelerating: decelerating, shouldShowJumpToPresent: shouldShowJumpToPresent,
isFirstMessageVisible: isFirstMessageVisible});
visibleMessagesWindowHandler.handleScrollPosition({rows: chatManager._rows,
firstVisibleMessageRowIndex: firstVisibleMessageIndex,
lastVisibleMessageRowIndex: lastVisibleMessageIndex});
}
}
global.__d(_fun86749, 11346, [31, 7729, 3, 4559, 9764, 690, 9850, 9852, 6531,
2]) /* metro module 11346, dependencies: [31, 7729, 3, 4559, 9764, 690, 9850, 9852, 6531, 2] */;