File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,23 @@ export class Notifier {
101
101
}
102
102
}
103
103
snackbar . buttons = buttons ;
104
+ for ( let i = 0 ; i < snackbar . buttons . length ; i ++ ) {
105
+ if ( snackbar . buttons [ i ] ?. classes && ! Array . isArray ( snackbar . buttons [ i ] ?. classes ) ) {
106
+ // @ts -ignore
107
+ snackbar . buttons [ i ] . classes = [ snackbar . buttons [ i ] . classes ] ;
108
+ }
109
+ if ( ! snackbar . buttons [ i ] ?. ariaLabel ) {
110
+ snackbar . buttons [ i ] . ariaLabel = null ;
111
+ }
112
+ if ( ! snackbar . buttons [ i ] ?. label || snackbar . buttons [ i ] ?. label . length === 0 ) {
113
+ console . error ( "Snackbar buttons require a label" ) ;
114
+ snackbar . buttons [ i ] . label = "Missing label" ;
115
+ }
116
+ if ( ! snackbar . buttons [ i ] ?. callback ) {
117
+ console . error ( "Snackbar buttons require a callback function" ) ;
118
+ snackbar . buttons [ i ] . callback = ( ) => { } ;
119
+ }
120
+ }
104
121
105
122
if ( snackbar . force && this . snackbarQueue . length ) {
106
123
this . snackbarQueue [ 0 ] . el . remove ( ) ;
You can’t perform that action at this time.
0 commit comments