decord/source/modules/favorites/FavoritesUtils.tsx
github-actions e510164e6b chore: update source for alpha 346.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
2026-09-10 05:38:07 +00:00

45 lines
1.4 KiB
TypeScript

// Module ID: 1982
// Function ID: 1983
// Name: FavoritesUtils
// Dependencies: [1970, 1074, 1114, 2]
// Exports: getFavoritesAwareGuildName, isFavoritableChannel, isFavoritesGuildCategoryNameValid, isFavoritesGuildId
// Module 1982 (FavoritesUtils)
import Constants from "Constants" /* 1074 */;
import util from "util" /* 1114 */;
import FavoritesConstants from "FavoritesConstants" /* 1970 */;
import size from "module_2" /* 2 */;
const FAVORITES_RAW_GUILD_ID = FavoritesConstants.FAVORITES_RAW_GUILD_ID;
const FAVORITES = Constants.FAVORITES;
const result = size.fileFinishedImporting("modules/favorites/FavoritesUtils.tsx");
export const getFavoritesAwareGuildName = function getFavoritesAwareGuildName(guild) {
if (null != guild) {
const id = guild.id;
let tmp2 = id === FAVORITES_RAW_GUILD_ID;
if (!tmp2) {
tmp2 = id === FAVORITES;
}
if (tmp2) {
const intl = util.intl;
let name = intl.string(util.t.wMWyci);
} else {
name = guild.name;
}
return name;
}
};
export function isFavoritesGuildId(guildId) {
let tmp = guildId === FAVORITES_RAW_GUILD_ID;
if (!tmp) {
tmp = guildId === FAVORITES;
}
return tmp;
}
export const isFavoritesGuildCategoryNameValid = function isFavoritesGuildCategoryNameValid(str) {
return "" !== str.trim();
};
export const isFavoritableChannel = function isFavoritableChannel(record) {
return !record.isCategory();
};