|
1 | 1 | import { number as currencyFromNumber } from 'currency-codes' |
2 | | -import { Disklet, justFiles, navigateDisklet } from 'disklet' |
| 2 | +import { Disklet, justFiles /* navigateDisklet */ } from 'disklet' |
3 | 3 |
|
4 | 4 | import { |
5 | 5 | EdgeAssetAction, |
@@ -301,6 +301,7 @@ export async function loadTxFiles( |
301 | 301 | * If they in the legacy format, convert them to the new format |
302 | 302 | * and cache them on disk |
303 | 303 | */ |
| 304 | +// eslint-disable-next-line @typescript-eslint/no-unused-vars |
304 | 305 | async function getLegacyFileNames( |
305 | 306 | state: RootState, |
306 | 307 | walletId: string, |
@@ -353,37 +354,37 @@ async function getLegacyFileNames( |
353 | 354 | export async function loadTxFileNames( |
354 | 355 | input: CurrencyWalletInput |
355 | 356 | ): Promise<void> { |
356 | | - const { dispatch, state, walletId } = input.props |
357 | | - const disklet = getStorageWalletDisklet(state, walletId) |
| 357 | + const { dispatch, /* state, */ walletId } = input.props |
| 358 | + // const disklet = getStorageWalletDisklet(state, walletId) |
358 | 359 |
|
359 | 360 | // Legacy transactions files: |
360 | | - const txFileNames: TxFileNames = await getLegacyFileNames( |
361 | | - state, |
362 | | - walletId, |
363 | | - navigateDisklet(disklet, 'Transactions') |
364 | | - ) |
| 361 | + // const txFileNames: TxFileNames = await getLegacyFileNames( |
| 362 | + // state, |
| 363 | + // walletId, |
| 364 | + // navigateDisklet(disklet, 'Transactions') |
| 365 | + // ) |
365 | 366 |
|
366 | 367 | // New transactions files: |
367 | | - const listing = await navigateDisklet(disklet, 'transaction').list() |
368 | | - for (const fileName of justFiles(listing)) { |
369 | | - const prefix = fileName.split('.json')[0] |
370 | | - const split: string[] = prefix.split('-') |
371 | | - const [creationDatePart, txidHash] = split |
372 | | - const creationDate = parseInt(creationDatePart) |
373 | | - |
374 | | - // Create entry in the txFileNames for the txidHash if it doesn't exist |
375 | | - // or the creation date is older than the existing one |
376 | | - if ( |
377 | | - txFileNames[txidHash] == null || |
378 | | - creationDate < txFileNames[txidHash].creationDate |
379 | | - ) { |
380 | | - txFileNames[txidHash] = { creationDate, fileName } |
381 | | - } |
382 | | - } |
| 368 | + // const listing = await navigateDisklet(disklet, 'transaction').list() |
| 369 | + // for (const fileName of justFiles(listing)) { |
| 370 | + // const prefix = fileName.split('.json')[0] |
| 371 | + // const split: string[] = prefix.split('-') |
| 372 | + // const [creationDatePart, txidHash] = split |
| 373 | + // const creationDate = parseInt(creationDatePart) |
| 374 | + |
| 375 | + // // Create entry in the txFileNames for the txidHash if it doesn't exist |
| 376 | + // // or the creation date is older than the existing one |
| 377 | + // if ( |
| 378 | + // txFileNames[txidHash] == null || |
| 379 | + // creationDate < txFileNames[txidHash].creationDate |
| 380 | + // ) { |
| 381 | + // txFileNames[txidHash] = { creationDate, fileName } |
| 382 | + // } |
| 383 | + // } |
383 | 384 |
|
384 | 385 | dispatch({ |
385 | 386 | type: 'CURRENCY_WALLET_FILE_NAMES_LOADED', |
386 | | - payload: { txFileNames, walletId } |
| 387 | + payload: { txFileNames: {}, walletId } |
387 | 388 | }) |
388 | 389 | } |
389 | 390 |
|
|
0 commit comments