@@ -71,9 +71,6 @@ export class Toast implements ComponentInterface, OverlayInterface {
7171 private customHTMLEnabled = config . get ( 'innerHTMLTemplatesEnabled' , ENABLE_HTML_CONTENT_DEFAULT ) ;
7272 private durationTimeout ?: ReturnType < typeof setTimeout > ;
7373 private gesture ?: Gesture ;
74- private get theme ( ) : Theme {
75- return getIonTheme ( this ) ;
76- }
7774
7875 /**
7976 * Holds the position of the toast calculated in the present
@@ -497,14 +494,14 @@ export class Toast implements ComponentInterface, OverlayInterface {
497494 }
498495
499496 private getShape ( ) : string | undefined {
500- const { theme , shape } = this ;
497+ const { shape } = this ;
501498
502499 // TODO(ROU-11300): Remove theme check when shapes are defined for all themes.
503- if ( theme !== 'ionic' ) {
500+ if ( getIonTheme ( this ) !== 'ionic' ) {
504501 return undefined ;
505502 }
506503
507- if ( theme === 'ionic' && shape === undefined ) {
504+ if ( shape === undefined ) {
508505 return 'round' ;
509506 }
510507
@@ -636,12 +633,11 @@ export class Toast implements ComponentInterface, OverlayInterface {
636633 } ;
637634
638635 renderButtons ( buttons : ToastButton [ ] , side : 'start' | 'end' ) {
639- const { theme } = this ;
640-
641636 if ( buttons . length === 0 ) {
642637 return ;
643638 }
644639
640+ const theme = getIonTheme ( this ) ;
645641 const buttonGroupsClasses = {
646642 'toast-button-group' : true ,
647643 [ `toast-button-group-${ side } ` ] : true ,
@@ -719,10 +715,11 @@ export class Toast implements ComponentInterface, OverlayInterface {
719715 }
720716
721717 render ( ) {
722- const { layout, el, revealContentToScreenReader, theme , header, message } = this ;
718+ const { layout, el, revealContentToScreenReader, header, message } = this ;
723719 const allButtons = this . getButtons ( ) ;
724720 const startButtons = allButtons . filter ( ( b ) => b . side === 'start' ) ;
725721 const endButtons = allButtons . filter ( ( b ) => b . side !== 'start' ) ;
722+ const theme = getIonTheme ( this ) ;
726723 const shape = this . getShape ( ) ;
727724 const wrapperClass = {
728725 'toast-wrapper' : true ,
0 commit comments