42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
// Module ID: 1841
|
|
// Function ID: 20208
|
|
// Name: isFavoritesGuildId
|
|
// Dependencies: [1386, 653, 1212, 2]
|
|
// Exports: canFavoriteChannelType, getFavoritesAwareGuildName, isFavoritesGuildCategoryNameValid
|
|
|
|
// Module 1841 (isFavoritesGuildId)
|
|
import { FAVORITES_RAW_GUILD_ID } from "date";
|
|
import { FAVORITES } from "ME";
|
|
|
|
function isFavoritesGuildId(guildId) {
|
|
let tmp = guildId === FAVORITES_RAW_GUILD_ID;
|
|
if (!tmp) {
|
|
tmp = guildId === FAVORITES;
|
|
}
|
|
return tmp;
|
|
}
|
|
const result = require("getSystemLocale").fileFinishedImporting("modules/favorites/FavoritesUtils.tsx");
|
|
|
|
export const getFavoritesAwareGuildName = function getFavoritesAwareGuildName(guild) {
|
|
if (null != guild) {
|
|
if (isFavoritesGuildId(guild.id)) {
|
|
const intl = require(1212) /* getSystemLocale */.intl;
|
|
let name = intl.string(require(1212) /* getSystemLocale */.t.wMWyci);
|
|
} else {
|
|
name = guild.name;
|
|
}
|
|
return name;
|
|
}
|
|
};
|
|
export { isFavoritesGuildId };
|
|
export const isFavoritesGuildCategoryNameValid = function isFavoritesGuildCategoryNameValid(first) {
|
|
return "" !== first.trim();
|
|
};
|
|
export const canFavoriteChannelType = function canFavoriteChannelType(record, hasHigherPrivileges) {
|
|
let tmp = !record.isCategory();
|
|
if (tmp) {
|
|
tmp = !record.isThread() || hasHigherPrivileges;
|
|
const tmp2 = !record.isThread() || hasHigherPrivileges;
|
|
}
|
|
return tmp;
|
|
};
|