decord/alpha/source/stores/DimensionStore.tsx

103 lines
3.1 KiB
TypeScript
Raw Normal View History

// Module ID: 5490
// Function ID: 5491
// Name: DimensionStore
// Dependencies: [558, 504, 573, 2]
2026-07-23 10:11:24 +00:00
// Module 5490 (DimensionStore)
import initializeDefault from "initialize" /* 504 */;
import discord_common_shallowEqualDefault from "discord_common/shallowEqual" /* 558 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
2026-07-20 16:05:17 +00:00
const dependencyMap = {};
const dependencyMap2 = {};
2026-07-29 08:29:29 +00:00
let closure_4 = { scrollTop: 0 };
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class DimensionStore extends Store {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = DimensionStore.prototype;
prototype["percentageScrolled"] = function percentageScrolled(arg0) {
if (null != dependencyMap[arg0]) {
return dependencyMap[arg0].scrollTop / dependencyMap[arg0].scrollHeight;
} else {
return 1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
prototype["getChannelDimensions"] = function getChannelDimensions(arg0) {
return dependencyMap[arg0];
};
prototype["getGuildDimensions"] = function getGuildDimensions(guildId) {
let tmp = dependencyMap2[guildId];
2026-07-29 08:29:29 +00:00
if (tmp == null) {
const obj = { guildId, scrollTop: null, scrollTo: null };
2026-07-29 08:29:29 +00:00
tmp = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
};
prototype["getGuildListDimensions"] = function getGuildListDimensions() {
return closure_4;
};
prototype["isAtBottom"] = function isAtBottom(channelId) {
let tmp;
if (null != dependencyMap[channelId]) {
tmp = tmp2.scrollTop === tmp2.scrollHeight - tmp2.offsetHeight;
}
return tmp;
};
DimensionStore.displayName = "DimensionStore";
const dimensionStore = new DimensionStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
UPDATE_CHANNEL_DIMENSIONS: function handleChannelScroll(arg0) {
({ channelId, scrollTop, scrollHeight, offsetHeight } = arg0);
if (null != scrollTop) {
if (null != scrollHeight) {
if (null != offsetHeight) {
const obj = { channelId, scrollTop, scrollHeight, offsetHeight };
2026-07-29 08:29:29 +00:00
if (null != tmp4) {
if (discord_common_shallowEqualDefault(tmp4, obj)) {
2026-07-20 16:05:17 +00:00
return false;
}
}
2026-07-29 08:29:29 +00:00
tmp3[channelId] = obj;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[channelId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
},
UPDATE_CHANNEL_LIST_DIMENSIONS: function handleGuildUpdate(arg0) {
({ guildId, scrollTop, scrollTo } = arg0);
2026-07-23 10:11:24 +00:00
if (null == dependencyMap2[guildId]) {
const obj = { guildId, scrollTop: null, scrollTo: null };
2026-07-29 08:29:29 +00:00
tmp[guildId] = obj;
2026-07-20 16:05:17 +00:00
}
if (undefined !== scrollTop) {
2026-07-29 08:29:29 +00:00
tmp[guildId].scrollTop = scrollTop;
2026-07-20 16:05:17 +00:00
}
let flag = false;
if (undefined !== scrollTo) {
2026-07-29 08:29:29 +00:00
flag = tmp[guildId].scrollTo !== scrollTo;
tmp[guildId].scrollTo = scrollTo;
2026-07-20 16:05:17 +00:00
}
return null != scrollTo || flag;
},
UPDATE_GUILD_LIST_DIMENSIONS: function handleGuildListUpdate(scrollTop) {
2026-07-29 08:29:29 +00:00
closure_4.scrollTop = scrollTop.scrollTop;
2026-07-20 16:05:17 +00:00
},
CALL_CREATE: function handleCallCreate(channelId) {
2026-07-29 08:29:29 +00:00
channelId = channelId.channelId;
let tmp3;
if (null != dependencyMap[channelId]) {
tmp3 = tmp4.scrollTop === tmp4.scrollHeight - tmp4.offsetHeight;
}
if (tmp3) {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
}
});
const size = fn(2);
const result = size.fileFinishedImporting("stores/DimensionStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default dimensionStore;