decord/source/stores/DimensionStore.tsx

108 lines
3.2 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 5096
// Function ID: 5097
2026-07-29 08:29:29 +00:00
// Name: percentageScrolled
// Dependencies: [643, 589, 709, 2]
2026-07-23 10:11:24 +00:00
2026-08-25 06:04:03 +00:00
// Module 5096 (percentageScrolled)
2026-08-24 06:08:38 +00:00
import initializeDefault from "initialize" /* 589 */;
import shallowEqualDefault from "shallowEqual" /* 643 */;
import dispatcherDefault from "dispatcher" /* 709 */;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
let closure_2 = {};
let closure_3 = {};
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(arg0) {
let tmp = dependencyMap2[arg0];
if (tmp == null) {
const obj = { guildId: null, scrollTop: null, scrollTo: null };
obj[0] = arg0;
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";
2026-08-24 06:08:38 +00:00
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) {
2026-07-29 08:29:29 +00:00
const obj = { channelId: null, scrollTop: null, scrollHeight: null, offsetHeight: null };
obj[0] = channelId;
obj[1] = scrollTop;
obj[2] = scrollHeight;
obj[3] = offsetHeight;
if (null != tmp4) {
2026-08-24 06:08:38 +00:00
if (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]) {
2026-07-29 08:29:29 +00:00
const obj = { guildId: null, scrollTop: null, scrollTo: null };
obj[0] = guildId;
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
}
}
});
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("stores/DimensionStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default dimensionStore;