@@ -49,16 +49,18 @@ export function getMessagingInWindow(app: FirebaseApp = getApp()): Messaging {
49
49
// initialization phase for performance consideration. An error would be thrown latter for
50
50
// developer's information. Developers can then choose to import and call `isSupported` for
51
51
// special handling.
52
- isWindowSupported ( )
53
- . then ( isSupported => {
52
+ isWindowSupported ( ) . then (
53
+ isSupported => {
54
54
// If `isWindowSupported()` resolved, but returned false.
55
55
if ( ! isSupported ) {
56
56
throw ERROR_FACTORY . create ( ErrorCode . UNSUPPORTED_BROWSER ) ;
57
57
}
58
- } , _ => {
58
+ } ,
59
+ _ => {
59
60
// If `isWindowSupported()` rejected.
60
61
throw ERROR_FACTORY . create ( ErrorCode . INDEXED_DB_UNSUPPORTED ) ;
61
- } ) ;
62
+ }
63
+ ) ;
62
64
return _getProvider ( getModularInstance ( app ) , 'messaging' ) . getImmediate ( ) ;
63
65
}
64
66
@@ -74,16 +76,18 @@ export function getMessagingInSw(app: FirebaseApp = getApp()): Messaging {
74
76
// initialization phase for performance consideration. An error would be thrown latter for
75
77
// developer's information. Developers can then choose to import and call `isSupported` for
76
78
// special handling.
77
- isSwSupported ( )
78
- . then ( isSupported => {
79
- // If `isSwSupported()` resolved, but returned false.
80
- if ( ! isSupported ) {
81
- throw ERROR_FACTORY . create ( ErrorCode . UNSUPPORTED_BROWSER ) ;
79
+ isSwSupported ( ) . then (
80
+ isSupported => {
81
+ // If `isSwSupported()` resolved, but returned false.
82
+ if ( ! isSupported ) {
83
+ throw ERROR_FACTORY . create ( ErrorCode . UNSUPPORTED_BROWSER ) ;
84
+ }
85
+ } ,
86
+ _ => {
87
+ // If `isSwSupported()` rejected.
88
+ throw ERROR_FACTORY . create ( ErrorCode . INDEXED_DB_UNSUPPORTED ) ;
82
89
}
83
- } , _ => {
84
- // If `isSwSupported()` rejected.
85
- throw ERROR_FACTORY . create ( ErrorCode . INDEXED_DB_UNSUPPORTED ) ;
86
- } ) ;
90
+ ) ;
87
91
return _getProvider ( getModularInstance ( app ) , 'messaging-sw' ) . getImmediate ( ) ;
88
92
}
89
93
0 commit comments