本文整理汇总了TypeScript中@providers/sites.CoreSitesProvider.isFeatureDisabled方法的典型用法代码示例。如果您正苦于以下问题:TypeScript CoreSitesProvider.isFeatureDisabled方法的具体用法?TypeScript CoreSitesProvider.isFeatureDisabled怎么用?TypeScript CoreSitesProvider.isFeatureDisabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@providers/sites.CoreSitesProvider
的用法示例。
在下文中一共展示了CoreSitesProvider.isFeatureDisabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
messagesProvider.isMessagingEnabledForSite(notification.site).then(() => {
sitesProvider.isFeatureDisabled('CoreMainMenuDelegate_AddonMessages', notification.site).then((disabled) => {
if (disabled) {
// Messages are disabled, stop.
return;
}
messagesProvider.invalidateDiscussionsCache(notification.site).finally(() => {
linkHelper.goInSite(undefined, 'AddonMessagesIndexPage', undefined, notification.site);
});
});
});
示例2:
const goToNotifications = (notification: any): void => {
sitesProvider.isFeatureDisabled('CoreMainMenuDelegate_AddonNotifications', notification.site).then((disabled) => {
if (disabled) {
// Notifications are disabled, stop.
return;
}
notificationsProvider.invalidateNotificationsList().finally(() => {
linkHelper.goInSite(undefined, 'AddonNotificationsListPage', undefined, notification.site);
});
});
};
示例3:
messagesProvider.isMessagingEnabledForSite(notification.site).then(() => {
sitesProvider.isFeatureDisabled('CoreMainMenuDelegate_AddonMessages', notification.site).then((disabled) => {
if (disabled) {
// Messages are disabled, stop.
return;
}
messagesProvider.invalidateDiscussionsCache(notification.site).finally(() => {
// Check if group messaging is enabled, to determine which page should be loaded.
messagesProvider.isGroupMessagingEnabledInSite(notification.site).then((enabled) => {
let pageName = 'AddonMessagesIndexPage';
if (enabled) {
pageName = 'AddonMessagesGroupConversationsPage';
}
linkHelper.goInSite(undefined, pageName, undefined, notification.site);
});
});
});
});