Skip to content

Commit 90154f9

Browse files
rorydbainjhen0409
authored andcommitted
Adds check for first query param for deltaBundleId (#277)
* Adds check for first query param for deltaBundleId * Fix lint error
1 parent e13162e commit 90154f9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

app/middlewares/delta/deltaUrlToBlobUrl.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ const cachedBundleUrls = new Map();
1616
export default async function deltaUrlToBlobUrl(deltaUrl) {
1717
const client = DeltaPatcher.get(deltaUrl);
1818

19-
const deltaBundleId = client.getLastBundleId()
20-
? `&deltaBundleId=${client.getLastBundleId()}`
19+
const lastBundleId = client.getLastBundleId();
20+
21+
const deltaBundleId = lastBundleId
22+
? `${lastBundleId.indexOf('?') === -1 ? '?' : '&'}deltaBundleId=${lastBundleId}`
2123
: '';
2224

25+
2326
const data = await fetch(deltaUrl + deltaBundleId);
2427
const bundle = await data.json();
2528

0 commit comments

Comments
 (0)