63 lines
2.8 KiB
TypeScript
63 lines
2.8 KiB
TypeScript
// Module ID: 7508
|
|
// Function ID: 7509
|
|
// Name: GuildSubscriptionsActionCreators
|
|
// Dependencies: [573, 7482, 2]
|
|
// Exports: subscribeChannel, subscribeChannelDimensions, subscribeGuild, subscribeMembers, subscribeToMemberUpdates, unsubscribeFromMemberUpdates, unsubscribeMembers
|
|
|
|
// Module 7508 (GuildSubscriptionsActionCreators)
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
import GuildChannelSubscriptions from "GuildChannelSubscriptions" /* 7482 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
let result = size.fileFinishedImporting("actions/GuildSubscriptionsActionCreators.tsx");
|
|
|
|
export const subscribeMembers = function subscribeMembers(guildId, userIds) {
|
|
DispatcherDefault.dispatch({ type: "GUILD_SUBSCRIPTIONS_MEMBERS_ADD", guildId, userIds });
|
|
};
|
|
export const unsubscribeMembers = function unsubscribeMembers(guildId, userIds) {
|
|
DispatcherDefault.dispatch({ type: "GUILD_SUBSCRIPTIONS_MEMBERS_REMOVE", guildId, userIds });
|
|
};
|
|
export const subscribeToMemberUpdates = function subscribeToMemberUpdates(guildId) {
|
|
DispatcherDefault.dispatch({ type: "GUILD_SUBSCRIPTIONS_ADD_MEMBER_UPDATES", guildId });
|
|
};
|
|
export const unsubscribeFromMemberUpdates = function unsubscribeFromMemberUpdates(guildId) {
|
|
DispatcherDefault.dispatch({ type: "GUILD_SUBSCRIPTIONS_REMOVE_MEMBER_UPDATES", guildId });
|
|
};
|
|
export const subscribeGuild = function subscribeGuild(guildId) {
|
|
DispatcherDefault.dispatch({ type: "GUILD_SUBSCRIPTIONS", guildId });
|
|
};
|
|
export const subscribeChannel = function subscribeChannel(guildId, channelId, ranges) {
|
|
DispatcherDefault.dispatch({ type: "GUILD_SUBSCRIPTIONS_CHANNEL", guildId, channelId, ranges });
|
|
};
|
|
export const subscribeChannelDimensions = function subscribeChannelDimensions(arg0) {
|
|
({ y, height, rowHeight } = arg0);
|
|
({ guildId, channelId } = arg0);
|
|
const bound = Math.max(0, Math.ceil(Math.ceil(0.5 * height / rowHeight)));
|
|
const bound1 = Math.max(0, Math.ceil(Math.ceil(y / rowHeight)) + -bound);
|
|
let num = bound;
|
|
const sum = y + height;
|
|
if (bound === undefined) {
|
|
num = 0;
|
|
}
|
|
const items = [];
|
|
const bound2 = Math.max(0, Math.ceil(Math.ceil(sum / rowHeight)) + num);
|
|
let bound3 = bound1;
|
|
if (bound1 > 0) {
|
|
const _Math = Math;
|
|
const diff = GuildChannelSubscriptions.MINIMUM_RANGE - 1;
|
|
const items1 = [0, diff];
|
|
items.push(items1);
|
|
bound3 = Math.max(diff + 1, bound1);
|
|
}
|
|
const rounded = Math.floor(bound3 / GuildChannelSubscriptions.MINIMUM_RANGE);
|
|
let result = rounded * GuildChannelSubscriptions.MINIMUM_RANGE;
|
|
if (result <= bound2) {
|
|
do {
|
|
let sum1 = result + (GuildChannelSubscriptions.MINIMUM_RANGE - 1);
|
|
let items2 = [result, sum1];
|
|
let arr2 = items.push(items2);
|
|
result = sum1 + 1;
|
|
} while (result <= bound2);
|
|
}
|
|
DispatcherDefault.dispatch({ type: "GUILD_SUBSCRIPTIONS_CHANNEL", guildId, channelId, ranges: items });
|
|
};
|