File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export class Config {
3333 }
3434
3535 set ( key : keyof IonicConfig , value ?: any ) {
36+ console . warn ( `[DEPRECATION][Config]: The Config.set() method is deprecated and will be removed in the next major release.` ) ;
3637 const c = getConfig ( ) ;
3738 if ( c ) {
3839 c . set ( key , value ) ;
@@ -44,7 +45,7 @@ export const ConfigToken = new InjectionToken<any>('USERCONFIG');
4445
4546const getConfig = ( ) : CoreConfig | null => {
4647 if ( typeof ( window as any ) !== 'undefined' ) {
47- const Ionic = ( window as IonicWindow ) . Ionic ;
48+ const Ionic = ( window as any as IonicWindow ) . Ionic ;
4849 if ( Ionic && Ionic . config ) {
4950 return Ionic . config ;
5051 }
Original file line number Diff line number Diff line change @@ -199,3 +199,16 @@ export const setupConfig = (config: IonicConfig) => {
199199 } ;
200200 return win . Ionic . config ;
201201} ;
202+
203+ export const getMode = ( ) : Mode => {
204+ const win = window as any ;
205+ const config = win && win . Ionic && win . Ionic . config ;
206+ if ( config ) {
207+ if ( config . mode ) {
208+ return config . mode ;
209+ } else {
210+ return config . get ( 'mode' ) ;
211+ }
212+ }
213+ return 'md' ;
214+ } ;
You can’t perform that action at this time.
0 commit comments