decord/beta/source/actions/MentionActionCreators.tsx
github-actions 6fbb1b046c chore: update source for beta 347.8
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-22 14:21:44 +00:00

64 lines
2.4 KiB
TypeScript

// Module ID: 16751
// Function ID: 16752
// Name: MentionActionCreators
// Dependencies: [1078, 577, 1275, 2]
// Module 16751 (MentionActionCreators)
import DispatcherDefault from "Dispatcher" /* 577 */;
import HTTPUtils from "HTTPUtils" /* 1275 */;
import Constants from "Constants" /* 1078 */;
import size from "module_2" /* 2 */;
({ Endpoints: c3, MAX_MENTIONS_PER_FETCH: closure_4 } = Constants);
const result = size.fileFinishedImporting("actions/MentionActionCreators.tsx");
export default {
setGuildFilter(arg0) {
({ guildFilter, roleFilter, everyoneFilter } = arg0);
DispatcherDefault.dispatch({ type: "SET_RECENT_MENTIONS_FILTER", guildFilter, roleFilter, everyoneFilter });
},
clearMentions() {
DispatcherDefault.dispatch({ type: "CLEAR_MENTIONS" });
},
truncateMentions(size) {
DispatcherDefault.dispatch({ type: "TRUNCATE_MENTIONS", size });
},
fetchRecentMentions(feature) {
const before = feature.before;
let limit = feature.limit;
if (limit === undefined) {
limit = closure_4;
}
let guildId = feature.guildId;
if (guildId === undefined) {
guildId = null;
}
let flag = feature.roles;
if (flag === undefined) {
flag = true;
}
let flag2 = feature.everyone;
if (flag2 === undefined) {
flag2 = true;
}
DispatcherDefault.dispatch({ type: "LOAD_RECENT_MENTIONS", guildId });
const HTTP = before(1275).HTTP;
const request = { url: constants.MENTIONS, query: { before, limit, guild_id: guildId, roles: flag, everyone: flag2, feature: feature.feature }, retries: 2, oldFormErrors: true, rejectWithError: true };
value = HTTP.get(request);
return value.then((body) => {
body = body.body;
DispatcherDefault.dispatch({ type: "LOAD_RECENT_MENTIONS_SUCCESS", messages: body, isAfter: null != before, hasMoreAfter: body.length >= React4 });
}, () => {
DispatcherDefault.dispatch({ type: "LOAD_RECENT_MENTIONS_FAILURE" });
});
},
deleteRecentMention(id) {
const HTTP = HTTPUtils.HTTP;
HTTP.del({ url: React3.MENTIONS_MESSAGE_ID(id), retries: 2, oldFormErrors: true, rejectWithError: true });
const obj = { url: React3.MENTIONS_MESSAGE_ID(id), retries: 2, oldFormErrors: true, rejectWithError: true };
DispatcherDefault.dispatch({ type: "RECENT_MENTION_DELETE", id });
},
setRecentMentionsStale() {
DispatcherDefault.dispatch({ type: "SET_RECENT_MENTIONS_STALE" });
}
};