@@ -16,7 +16,7 @@ import { Injectable } from '@angular/core';
1616
1717import { CoreLang , CoreLangFormat , CoreLangLanguage } from '@services/lang' ;
1818import { CoreSites } from '@services/sites' ;
19- import { CoreConstants } from '@/core/constants' ;
19+ import { CoreConstants , CoreLinkOpenMethod } from '@/core/constants' ;
2020import { CoreMainMenuDelegate , CoreMainMenuHandlerToDisplay } from './mainmenu-delegate' ;
2121import { Device , makeSingleton } from '@singletons' ;
2222import { CoreText } from '@singletons/text' ;
@@ -113,7 +113,7 @@ export class CoreMainMenuProvider {
113113
114114 let position = 0 ; // Position of each item, to keep the same order as it's configured.
115115
116- if ( ! itemsString || typeof itemsString != 'string' ) {
116+ if ( ! itemsString || typeof itemsString !== 'string' ) {
117117 // Setting not valid.
118118 return result ;
119119 }
@@ -136,7 +136,9 @@ export class CoreMainMenuProvider {
136136 const id = `${ url } #${ type } ` ;
137137 if ( ! icon ) {
138138 // Icon not defined, use default one.
139- icon = type == 'embedded' ? 'fas-expand' : 'fas-link' ; // @todo Find a better icon for embedded.
139+ icon = type == CoreLinkOpenMethod . EMBEDDED
140+ ? 'fas-expand' // @todo Find a better icon for embedded.
141+ : 'fas-link' ;
140142 }
141143
142144 if ( ! map [ id ] ) {
@@ -283,7 +285,7 @@ export class CoreMainMenuProvider {
283285 * @returns Promise resolved with boolean: whether it's the root of a main menu tab.
284286 */
285287 async isMainMenuTab ( pageName : string ) : Promise < boolean > {
286- if ( pageName == MAIN_MENU_MORE_PAGE_NAME ) {
288+ if ( pageName === MAIN_MENU_MORE_PAGE_NAME ) {
287289 return true ;
288290 }
289291
@@ -330,7 +332,7 @@ export interface CoreMainMenuCustomItem {
330332 /**
331333 * Type of the item: app, inappbrowser, browser or embedded.
332334 */
333- type : string ;
335+ type : CoreLinkOpenMethod ;
334336
335337 /**
336338 * Url of the item.
@@ -360,7 +362,7 @@ export type CoreMainMenuLocalizedCustomItem = Omit<CoreMainMenuCustomItem, 'labe
360362 */
361363type CustomMenuItemsMap = Record < string , {
362364 url : string ;
363- type : string ;
365+ type : CoreLinkOpenMethod ;
364366 position : number ;
365367 labels : {
366368 [ lang : string ] : {
0 commit comments