62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
// Module ID: 7227
|
|
// Function ID: 7228
|
|
// Name: GuildProfileUtils
|
|
// Dependencies: [2055, 1085, 2066, 2]
|
|
// Exports: getEstablishedDate, guildInviteCanEmbedProfile
|
|
|
|
// Module 7227 (GuildProfileUtils)
|
|
import Constants from "Constants" /* 1085 */;
|
|
import ChannelRecord from "ChannelRecord" /* 2055 */;
|
|
import GuildRecordUtils from "GuildRecordUtils" /* 2066 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
let closure_2 = ChannelRecord.createChannelRecordFromInvite;
|
|
const GuildFeatures = Constants.GuildFeatures;
|
|
const result = size.fileFinishedImporting("modules/guild_profile/GuildProfileUtils.tsx");
|
|
|
|
export const getEstablishedDate = function getEstablishedDate(tmp2Result4, stateFromStores) {
|
|
if (null != tmp2Result4) {
|
|
if ("" !== tmp2Result4) {
|
|
const _Date = Date;
|
|
const self = this;
|
|
const self2 = this;
|
|
const date = new Date(tmp2Result4);
|
|
const _Date2 = Date;
|
|
let toLocaleDateStringResult = null;
|
|
if (date instanceof Date) {
|
|
const _isNaN = isNaN;
|
|
toLocaleDateStringResult = null;
|
|
if (!isNaN(date.getTime())) {
|
|
toLocaleDateStringResult = date.toLocaleDateString(stateFromStores, { year: "numeric", month: "short" });
|
|
}
|
|
}
|
|
return toLocaleDateStringResult;
|
|
}
|
|
}
|
|
return null;
|
|
};
|
|
export const guildInviteCanEmbedProfile = function guildInviteCanEmbedProfile(guild) {
|
|
if (null == guild.guild) {
|
|
return false;
|
|
} else {
|
|
const obj = GuildRecordUtils;
|
|
const features = obj.fromInviteGuild(guild.guild).features;
|
|
if (features.has(GuildFeatures.HUB)) {
|
|
return false;
|
|
} else {
|
|
let channel;
|
|
if (guild != null) {
|
|
channel = guild.channel;
|
|
}
|
|
let tmp2 = null;
|
|
if (null != channel) {
|
|
tmp2 = closure_2(guild.channel);
|
|
}
|
|
let isGuildVoiceOrThreadResult;
|
|
if (tmp2 != null) {
|
|
isGuildVoiceOrThreadResult = tmp2.isGuildVoiceOrThread();
|
|
}
|
|
return !isGuildVoiceOrThreadResult;
|
|
}
|
|
}
|
|
};
|