Commit 220a809 1 parent 93d05dd commit 220a809 Copy full SHA for 220a809
File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ const transition = (function() {
87
87
return Promise . resolve ( null ) ;
88
88
}
89
89
// Returned the transition page
90
- this . log ( 'fetchWithPageTransition: return transition page' ) ;
91
90
return this . fetchTransitionPage ( request , transitionPage ) ;
92
91
}
93
92
@@ -105,13 +104,20 @@ const transition = (function() {
105
104
return caches . match ( new Request ( transitionPage ) )
106
105
. then ( response => {
107
106
if ( ! response ) {
108
- this . log ( 'fetchWithPageTransition : loading page not found in cache' ) ;
107
+ this . log ( 'fetchTransitionPage : loading page not found in cache' ) ;
109
108
return Promise . resolve ( null ) ;
110
109
}
110
+ this . log ( 'fetchTransitionPage: return transition page' ) ;
111
111
// Fetch the actual page and notify transition page when it's ready
112
- this . openCache ( ) . then ( cache =>
113
- cache . add ( request ) . then ( ( ) => this . notifyListeners ( request . url ) )
114
- ) ;
112
+ this . openCache ( )
113
+ . then ( cache => cache . add ( request )
114
+ . then ( ( ) => this . notifyListeners ( request . url ) )
115
+ . catch ( ( ) => {
116
+ // offline
117
+ console . log ( 'handling offline case' ) ;
118
+ this . notifyListeners ( request . url ) ;
119
+ } )
120
+ ) ;
115
121
return Promise . resolve ( response ) ;
116
122
} ) ;
117
123
}
You can’t perform that action at this time.
0 commit comments