Skip to content

Commit 7ead7c4

Browse files
committed
fix: simplify download URL retrieval based on policy server presence
1 parent 2ff50cf commit 7ead7c4

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

src/commands.ts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,24 @@ export class Commands {
244244

245245
const orderTx = await tx.wait();
246246

247-
const urlDownloadUrl = await ProviderInstance.getDownloadUrl(
248-
dataDdo.id,
249-
serviceId,
250-
0,
251-
orderTx.hash,
252-
this.oceanNodeUrl,
253-
this.signer,
254-
policyServer
255-
);
247+
const urlDownloadUrl = policyServer
248+
? await ProviderInstance.getDownloadUrl(
249+
dataDdo.id,
250+
serviceId,
251+
0,
252+
orderTx.hash,
253+
this.oceanNodeUrl,
254+
this.signer,
255+
policyServer
256+
)
257+
: await ProviderInstance.getDownloadUrl(
258+
dataDdo.id,
259+
serviceId,
260+
0,
261+
orderTx.hash,
262+
this.oceanNodeUrl,
263+
this.signer
264+
);
256265
try {
257266
const path = args[2] ? args[2] : ".";
258267
const { filename } = await downloadFile(urlDownloadUrl, path);

0 commit comments

Comments
 (0)