File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ import {
53
53
_getChild as _getChildInternal
54
54
} from '../src/reference' ;
55
55
import { STORAGE_TYPE } from './constants' ;
56
+ import { getModularInstance } from '@firebase/util' ;
56
57
57
58
/**
58
59
* Public types.
@@ -255,10 +256,14 @@ export function ref(
255
256
serviceOrRef : StorageService | StorageReference ,
256
257
pathOrUrl ?: string
257
258
) : StorageReference | null {
258
- return refInternal (
259
- serviceOrRef as StorageServiceInternal | Reference ,
260
- pathOrUrl
261
- ) ;
259
+ if ( serviceOrRef instanceof Reference ) {
260
+ return refInternal ( serviceOrRef as Reference , pathOrUrl ) ;
261
+ } else {
262
+ return refInternal (
263
+ getModularInstance ( serviceOrRef ) as StorageServiceInternal ,
264
+ pathOrUrl
265
+ ) ;
266
+ }
262
267
}
263
268
264
269
/**
@@ -284,7 +289,7 @@ export function getStorage(
284
289
) : StorageService {
285
290
// Dependencies
286
291
const storageProvider : Provider < 'storage-exp' > = _getProvider (
287
- app ,
292
+ getModularInstance ( app ) ,
288
293
STORAGE_TYPE
289
294
) ;
290
295
const storageInstance = storageProvider . getImmediate ( {
You can’t perform that action at this time.
0 commit comments