Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
// Module ID: 9053
|
|
// Function ID: 9054
|
|
// Name: canViewInviteModal
|
|
// Dependencies: [1074, 2]
|
|
// Exports: canViewInviteModal
|
|
|
|
// Module 9053 (canViewInviteModal)
|
|
import Constants from "Constants" /* 1074 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const Permissions = Constants.Permissions;
|
|
const result = size.fileFinishedImporting("modules/instant_invite/canViewInviteModal.tsx");
|
|
|
|
export const canViewInviteModal = function canViewInviteModal(PermissionStore, guild, defaultChannel, stageInstanceByChannel) {
|
|
let tmp = defaultChannel;
|
|
if (defaultChannel == null) {
|
|
tmp = guild;
|
|
}
|
|
let canResult = null != tmp;
|
|
if (canResult) {
|
|
canResult = PermissionStore.can(Permissions.CREATE_INSTANT_INVITE, tmp);
|
|
}
|
|
if (!canResult) {
|
|
canResult = null != guild && null != guild.vanityURLCode;
|
|
const tmp5 = null != guild && null != guild.vanityURLCode;
|
|
}
|
|
if (!canResult) {
|
|
let invite_code;
|
|
if (stageInstanceByChannel != null) {
|
|
invite_code = stageInstanceByChannel.invite_code;
|
|
}
|
|
canResult = null != invite_code;
|
|
}
|
|
return canResult;
|
|
};
|