Skip to content

Commit

Permalink
silence errors
Browse files Browse the repository at this point in the history
  • Loading branch information
geoknee committed Oct 9, 2023
1 parent c67e1b7 commit 7c6e3f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/payment-proxy-client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export default function App() {
[hub],
initialChannelBalance
);
console.timeEnd("Create Payment Channel");

// TODO: If the objective completes fast enough, we might start waiting after it's already done
// await nitroClient.WaitForObjective(result.Id);
Expand Down Expand Up @@ -183,8 +184,7 @@ export default function App() {
selectedFile.url,
skipPayment ? 0 : costPerByte * selectedFile.size,
paymentChannelInfo.ID,
nitroClient,
() => {}
nitroClient
);
setDownloadProgress(100);
triggerFileDownload(file);
Expand Down
4 changes: 2 additions & 2 deletions packages/payment-proxy-client/src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export async function fetchFile(
paymentAmount: number,
channelId: string,
nitroClient: NitroRpcClient,
updateChannelCallback: () => void
updateChannelCallback?: () => void
): Promise<File> {
console.time("Create Payment Vouncher");
const voucher = await nitroClient.CreateVoucher(channelId, paymentAmount);
Expand All @@ -15,7 +15,7 @@ export async function fetchFile(
console.time("Fetch file");
const req = createRequest(url, voucher);
const fetchPromise = fetch(req);
updateChannelCallback();
updateChannelCallback && updateChannelCallback();
const response = await fetchPromise;
console.timeEnd("Fetch file");
if (response.status != 200) {
Expand Down

0 comments on commit 7c6e3f5

Please sign in to comment.