MOBILE-4498 blog: Use advanced features to check if blog is enabled
parent
41f005d65a
commit
65ed0d2b1c
|
@ -18,6 +18,7 @@ import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
|
|||
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
|
||||
import { AddonBlockBlogMenuComponent } from '../components/blogmenu/blogmenu';
|
||||
import { makeSingleton } from '@singletons';
|
||||
import { AddonBlog } from '@addons/blog/services/blog';
|
||||
|
||||
/**
|
||||
* Block handler.
|
||||
|
@ -28,6 +29,13 @@ export class AddonBlockBlogMenuHandlerService extends CoreBlockBaseHandler {
|
|||
name = 'AddonBlockBlogMenu';
|
||||
blockName = 'blog_menu';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
async isEnabled(): Promise<boolean> {
|
||||
return await AddonBlog.isPluginEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data needed to render the block.
|
||||
*
|
||||
|
|
|
@ -18,6 +18,7 @@ import { CoreBlockHandlerData } from '@features/block/services/block-delegate';
|
|||
import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler';
|
||||
import { AddonBlockBlogRecentComponent } from '../components/blogrecent/blogrecent';
|
||||
import { makeSingleton } from '@singletons';
|
||||
import { AddonBlog } from '@addons/blog/services/blog';
|
||||
|
||||
/**
|
||||
* Block handler.
|
||||
|
@ -28,6 +29,13 @@ export class AddonBlockBlogRecentHandlerService extends CoreBlockBaseHandler {
|
|||
name = 'AddonBlockBlogRecent';
|
||||
blockName = 'blog_recent';
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
async isEnabled(): Promise<boolean> {
|
||||
return await AddonBlog.isPluginEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data needed to render the block.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue