Skip to content

Commit cccbfa1

Browse files
committed
Do storage
1 parent 019e945 commit cccbfa1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

packages/storage/exp/api.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import {
5353
_getChild as _getChildInternal
5454
} from '../src/reference';
5555
import { STORAGE_TYPE } from './constants';
56+
import { getModularInstance } from '@firebase/util';
5657

5758
/**
5859
* Public types.
@@ -255,10 +256,14 @@ export function ref(
255256
serviceOrRef: StorageService | StorageReference,
256257
pathOrUrl?: string
257258
): 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+
}
262267
}
263268

264269
/**
@@ -284,7 +289,7 @@ export function getStorage(
284289
): StorageService {
285290
// Dependencies
286291
const storageProvider: Provider<'storage-exp'> = _getProvider(
287-
app,
292+
getModularInstance(app),
288293
STORAGE_TYPE
289294
);
290295
const storageInstance = storageProvider.getImmediate({

0 commit comments

Comments
 (0)