mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
fix(config): allow LogLevel to work with isolatedModules and update all warns and errors to respect logLevel (#30350)
Issue number: internal --------- ## What is the current behavior? - `LogLevel` throws error `Error: Cannot access ambient const enums when 'isolatedModules' is enabled` - Several existing console warns and errors are not calling the function that respects the `logLevel` config ## What is the new behavior? - Remove `const` from the `enum` to work with `isolatedModules` - Update `console.warn`s to `printIonWarning` - Update `console.error`s to `printIonError` ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information Dev build: `8.5.5-dev.11744729748.174bf7e0` --------- Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
This commit is contained in:
@ -427,7 +427,7 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
||||
}
|
||||
|
||||
if (breakpoints !== undefined && initialBreakpoint !== undefined && !breakpoints.includes(initialBreakpoint)) {
|
||||
printIonWarning('Your breakpoints array must include the initialBreakpoint value.');
|
||||
printIonWarning('[ion-modal] - Your breakpoints array must include the initialBreakpoint value.');
|
||||
}
|
||||
|
||||
if (!this.htmlAttributes?.id) {
|
||||
@ -847,12 +847,12 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
||||
@Method()
|
||||
async setCurrentBreakpoint(breakpoint: number): Promise<void> {
|
||||
if (!this.isSheetModal) {
|
||||
printIonWarning('setCurrentBreakpoint is only supported on sheet modals.');
|
||||
printIonWarning('[ion-modal] - setCurrentBreakpoint is only supported on sheet modals.');
|
||||
return;
|
||||
}
|
||||
if (!this.breakpoints!.includes(breakpoint)) {
|
||||
printIonWarning(
|
||||
`Attempted to set invalid breakpoint value ${breakpoint}. Please double check that the breakpoint value is part of your defined breakpoints.`
|
||||
`[ion-modal] - Attempted to set invalid breakpoint value ${breakpoint}. Please double check that the breakpoint value is part of your defined breakpoints.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user