File tree Expand file tree Collapse file tree 3 files changed +12
-23
lines changed Expand file tree Collapse file tree 3 files changed +12
-23
lines changed Original file line number Diff line number Diff line change @@ -256,17 +256,12 @@ export class FirebaseDatabase implements _FirebaseService {
256
256
}
257
257
258
258
_delete ( ) : Promise < void > {
259
- this . _checkNotDeleted ( 'delete' ) ;
260
- repoManagerDeleteRepo ( this . _repo , this . app . name ) ;
261
- this . _repoInternal = null ;
262
- this . _rootInternal = null ;
263
- return Promise . resolve ( ) ;
264
- }
265
-
266
- _checkNotDeleted ( apiName : string ) {
267
- if ( this . _rootInternal === null ) {
268
- fatal ( 'Cannot call ' + apiName + ' on a deleted database.' ) ;
259
+ if ( this . _rootInternal !== null ) {
260
+ repoManagerDeleteRepo ( this . _repo , this . app . name ) ;
261
+ this . _repoInternal = null ;
262
+ this . _rootInternal = null ;
269
263
}
264
+ return Promise . resolve ( ) ;
270
265
}
271
266
}
272
267
Original file line number Diff line number Diff line change @@ -33,18 +33,10 @@ import { Compat } from '@firebase/util';
33
33
* @param opt_url gs:// url to a custom Storage Bucket
34
34
*/
35
35
export class StorageServiceCompat
36
- implements types . FirebaseStorage , Compat < StorageService > {
36
+ implements types . FirebaseStorage , Compat < StorageService >
37
+ {
37
38
constructor ( public app : FirebaseApp , readonly _delegate : StorageService ) { }
38
39
39
- INTERNAL = {
40
- /**
41
- * Called when the associated app is deleted.
42
- */
43
- delete : ( ) => {
44
- return this . _delegate . _delete ( ) ;
45
- }
46
- } ;
47
-
48
40
get maxOperationRetryTime ( ) : number {
49
41
return this . _delegate . maxOperationRetryTime ;
50
42
}
Original file line number Diff line number Diff line change @@ -269,9 +269,11 @@ export class StorageService implements _FirebaseService {
269
269
* Stop running requests and prevent more from being created.
270
270
*/
271
271
_delete ( ) : Promise < void > {
272
- this . _deleted = true ;
273
- this . _requests . forEach ( request => request . cancel ( ) ) ;
274
- this . _requests . clear ( ) ;
272
+ if ( ! this . _deleted ) {
273
+ this . _deleted = true ;
274
+ this . _requests . forEach ( request => request . cancel ( ) ) ;
275
+ this . _requests . clear ( ) ;
276
+ }
275
277
return Promise . resolve ( ) ;
276
278
}
277
279
You can’t perform that action at this time.
0 commit comments