2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 11019
|
|
|
|
|
// Function ID: 11020
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: getMessageJumpData
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [32, 19, 1481, 1372, 1364, 1879, 4763, 11, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: default, useMessageJumpAndroidKeyboardHeight
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 11019 (getMessageJumpData)
|
2026-09-18 19:45:33 +00:00
|
|
|
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import flow_Client from "flow/Client" /* 4763 */;
|
|
|
|
|
import _slicedToArray from "_slicedToArray" /* 32 */;
|
|
|
|
|
import react from "react" /* 19 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import subscribeToKeyboardUIStore from "subscribeToKeyboardUIStore" /* 1481 */;
|
2026-09-26 17:57:22 +00:00
|
|
|
import UserStore from "UserStore" /* 1372 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp;
|
|
|
|
|
let tmp4;
|
|
|
|
|
const PlatformUtils = tmp4(1364);
|
2026-09-28 16:18:32 +00:00
|
|
|
const useSystemKeyboardHeight = tmp(1879);
|
2026-09-18 19:45:33 +00:00
|
|
|
const result = size.fileFinishedImporting("components_native/chat/getMessageJumpData.tsx");
|
|
|
|
|
|
|
|
|
|
export default function getMessageJumpData(messages, isAtBottom, messages2) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channelId;
|
|
|
|
|
let flag;
|
|
|
|
|
let focusTargetId;
|
|
|
|
|
let id;
|
|
|
|
|
let jumpSequenceId;
|
|
|
|
|
let jumpTargetId;
|
|
|
|
|
let jumpType;
|
|
|
|
|
let tmp12;
|
|
|
|
|
let tmp15;
|
2026-09-18 19:45:33 +00:00
|
|
|
messages = messages.messages;
|
|
|
|
|
const lastResult = messages.last();
|
|
|
|
|
messages2 = messages2.messages;
|
|
|
|
|
const lastResult1 = messages2.last();
|
|
|
|
|
const currentUser = UserStore.getCurrentUser();
|
2026-10-01 14:13:23 +00:00
|
|
|
const ANIMATED = flow_Client.JumpType.ANIMATED;
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp7 = tmp6;
|
|
|
|
|
({ jumpSequenceId, focusTargetId } = messages);
|
|
|
|
|
if (messages.initialScrollSequenceId === messages2.initialScrollSequenceId) {
|
|
|
|
|
tmp7 = messages2.jumpSequenceId !== messages.jumpSequenceId;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp8 = messages.initialScrollSequenceId !== messages2.initialScrollSequenceId || messages2.focusSequenceId !== messages.focusSequenceId;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != messages.jumpTargetId) {
|
|
|
|
|
if (tmp7) {
|
|
|
|
|
({ channelId, jumpTargetId } = messages);
|
|
|
|
|
const firstResult = messages.first();
|
2026-10-01 14:13:23 +00:00
|
|
|
if (channelId === jumpTargetId) {
|
|
|
|
|
let jumpTargetId2;
|
|
|
|
|
if (null != firstResult) {
|
|
|
|
|
jumpTargetId2 = firstResult.id;
|
|
|
|
|
}
|
|
|
|
|
jumpType = messages.jumpType;
|
|
|
|
|
flag = false;
|
|
|
|
|
tmp12 = jumpTargetId2;
|
|
|
|
|
id = jumpTargetId2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
jumpTargetId2 = messages.jumpTargetId;
|
|
|
|
|
}
|
|
|
|
|
const obj2 = { scrollToMessageId: id, jumpTargetId: tmp12, jumpType, jumpSequenceId, minimizeScrolling: flag, focusTargetId: tmp15, shouldInitialScroll: messages.initialScrollSequenceId !== messages2.initialScrollSequenceId };
|
|
|
|
|
tmp15 = null;
|
|
|
|
|
if (tmp8) {
|
|
|
|
|
tmp15 = focusTargetId;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return obj2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (!isAtBottom.isAtBottom) {
|
|
|
|
|
if (isAtBottom.hasPreviousMessages) {
|
|
|
|
|
if (!messages2.loadingMore) {
|
|
|
|
|
if (null != lastResult) {
|
|
|
|
|
if (null != currentUser) {
|
|
|
|
|
if (lastResult.author.id === currentUser.id) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null != lastResult1) {
|
|
|
|
|
SnowflakeUtilsDefault;
|
|
|
|
|
}
|
|
|
|
|
id = lastResult.id;
|
|
|
|
|
flag = false;
|
|
|
|
|
jumpType = ANIMATED;
|
|
|
|
|
tmp12 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
const interaction = lastResult.interaction;
|
|
|
|
|
let id1;
|
|
|
|
|
if (interaction != null) {
|
|
|
|
|
id1 = interaction.user.id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!messages.loadingMore) {
|
|
|
|
|
if (messages.jumpedToPresent) {
|
|
|
|
|
if (tmp7) {
|
|
|
|
|
if (null != lastResult) {
|
|
|
|
|
id = lastResult.id;
|
|
|
|
|
flag = false;
|
2026-10-01 14:13:23 +00:00
|
|
|
jumpType = ANIMATED;
|
|
|
|
|
tmp12 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
flag = false;
|
2026-10-01 14:13:23 +00:00
|
|
|
jumpType = ANIMATED;
|
|
|
|
|
tmp12 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
id = null;
|
2026-10-01 14:13:23 +00:00
|
|
|
const tmp4Result = PlatformUtils;
|
|
|
|
|
const tmp13 = tmp4Result.isAndroid() && messages2.androidKeyboardHeight < messages.androidKeyboardHeight && null != messages.replyingMessageId;
|
|
|
|
|
if (tmp13) {
|
2026-09-18 19:45:33 +00:00
|
|
|
id = messages.replyingMessageId;
|
|
|
|
|
flag = true;
|
2026-10-01 14:13:23 +00:00
|
|
|
jumpType = ANIMATED;
|
|
|
|
|
tmp12 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
};
|
2026-09-26 17:57:22 +00:00
|
|
|
export const useMessageJumpAndroidKeyboardHeight = function useMessageJumpAndroidKeyboardHeight() {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp4;
|
|
|
|
|
let obj = react;
|
|
|
|
|
const useState = react.useState;
|
2026-09-18 19:45:33 +00:00
|
|
|
let num = 0;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj2 = PlatformUtils;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (obj2.isAndroid()) {
|
|
|
|
|
const tmpResult = useSystemKeyboardHeight;
|
2026-10-01 14:13:23 +00:00
|
|
|
num = tmpResult.getSystemKeyboardHeight();
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
[tmp4, require] = _slicedToArray(useState(num), 2);
|
|
|
|
|
const tmp3 = _slicedToArray(useState(num), 2);
|
2026-09-18 19:45:33 +00:00
|
|
|
const effect = obj.useEffect(() => subscribeToKeyboardUIStore((keyboardHeight) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = PlatformUtils;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (obj.isAndroid()) {
|
|
|
|
|
closure_1_0(keyboardHeight.keyboardHeight);
|
|
|
|
|
}
|
|
|
|
|
}), []);
|
|
|
|
|
return tmp4;
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|