Skip to content

Commit

Permalink
fix tokens select order
Browse files Browse the repository at this point in the history
  • Loading branch information
vorujack committed Sep 14, 2024
1 parent ffbedf9 commit 5061533
Show file tree
Hide file tree
Showing 10 changed files with 90 additions and 94 deletions.
5 changes: 5 additions & 0 deletions apps/wallet/.changeset/nasty-apes-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'minotaur-wallet': patch
---

Fix token select order
22 changes: 11 additions & 11 deletions apps/wallet/android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
include ':capacitor-android'
project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
project(':capacitor-android').projectDir = new File('../../../node_modules/@capacitor/android/capacitor')

include ':capacitor-community-sqlite'
project(':capacitor-community-sqlite').projectDir = new File('../node_modules/@capacitor-community/sqlite/android')
project(':capacitor-community-sqlite').projectDir = new File('../../../node_modules/@capacitor-community/sqlite/android')

include ':capacitor-mlkit-barcode-scanning'
project(':capacitor-mlkit-barcode-scanning').projectDir = new File('../node_modules/@capacitor-mlkit/barcode-scanning/android')
project(':capacitor-mlkit-barcode-scanning').projectDir = new File('../../../node_modules/@capacitor-mlkit/barcode-scanning/android')

include ':capacitor-app'
project(':capacitor-app').projectDir = new File('../node_modules/@capacitor/app/android')
project(':capacitor-app').projectDir = new File('../../../node_modules/@capacitor/app/android')

include ':capacitor-browser'
project(':capacitor-browser').projectDir = new File('../node_modules/@capacitor/browser/android')
project(':capacitor-browser').projectDir = new File('../../../node_modules/@capacitor/browser/android')

include ':capacitor-camera'
project(':capacitor-camera').projectDir = new File('../node_modules/@capacitor/camera/android')
project(':capacitor-camera').projectDir = new File('../../../node_modules/@capacitor/camera/android')

include ':capacitor-clipboard'
project(':capacitor-clipboard').projectDir = new File('../node_modules/@capacitor/clipboard/android')
project(':capacitor-clipboard').projectDir = new File('../../../node_modules/@capacitor/clipboard/android')

include ':capacitor-filesystem'
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')
project(':capacitor-filesystem').projectDir = new File('../../../node_modules/@capacitor/filesystem/android')

include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')
project(':capacitor-status-bar').projectDir = new File('../../../node_modules/@capacitor/status-bar/android')

include ':capacitor-toast'
project(':capacitor-toast').projectDir = new File('../node_modules/@capacitor/toast/android')
project(':capacitor-toast').projectDir = new File('../../../node_modules/@capacitor/toast/android')

include ':capacitor-plugin-safe-area'
project(':capacitor-plugin-safe-area').projectDir = new File('../node_modules/capacitor-plugin-safe-area/android')
project(':capacitor-plugin-safe-area').projectDir = new File('../../../node_modules/capacitor-plugin-safe-area/android')
26 changes: 13 additions & 13 deletions apps/wallet/ios/App/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers'
require_relative '../../../../node_modules/@capacitor/ios/scripts/pods_helpers'

platform :ios, '13.0'
use_frameworks!
Expand All @@ -9,18 +9,18 @@ use_frameworks!
install! 'cocoapods', :disable_input_output_paths => true

def capacitor_pods
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
pod 'CapacitorCommunitySqlite', :path => '../../node_modules/@capacitor-community/sqlite'
pod 'CapacitorMlkitBarcodeScanning', :path => '../../node_modules/@capacitor-mlkit/barcode-scanning'
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser'
pod 'CapacitorCamera', :path => '../../node_modules/@capacitor/camera'
pod 'CapacitorClipboard', :path => '../../node_modules/@capacitor/clipboard'
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
pod 'CapacitorToast', :path => '../../node_modules/@capacitor/toast'
pod 'CapacitorPluginSafeArea', :path => '../../node_modules/capacitor-plugin-safe-area'
pod 'Capacitor', :path => '../../../../node_modules/@capacitor/ios'
pod 'CapacitorCordova', :path => '../../../../node_modules/@capacitor/ios'
pod 'CapacitorCommunitySqlite', :path => '../../../../node_modules/@capacitor-community/sqlite'
pod 'CapacitorMlkitBarcodeScanning', :path => '../../../../node_modules/@capacitor-mlkit/barcode-scanning'
pod 'CapacitorApp', :path => '../../../../node_modules/@capacitor/app'
pod 'CapacitorBrowser', :path => '../../../../node_modules/@capacitor/browser'
pod 'CapacitorCamera', :path => '../../../../node_modules/@capacitor/camera'
pod 'CapacitorClipboard', :path => '../../../../node_modules/@capacitor/clipboard'
pod 'CapacitorFilesystem', :path => '../../../../node_modules/@capacitor/filesystem'
pod 'CapacitorStatusBar', :path => '../../../../node_modules/@capacitor/status-bar'
pod 'CapacitorToast', :path => '../../../../node_modules/@capacitor/toast'
pod 'CapacitorPluginSafeArea', :path => '../../../../node_modules/capacitor-plugin-safe-area'
end

target 'App' do
Expand Down
86 changes: 43 additions & 43 deletions apps/wallet/ios/App/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
PODS:
- Capacitor (5.6.0):
- Capacitor (5.7.8):
- CapacitorCordova
- CapacitorApp (5.0.7):
- CapacitorApp (5.0.8):
- Capacitor
- CapacitorBrowser (5.2.0):
- CapacitorBrowser (5.2.1):
- Capacitor
- CapacitorCamera (5.0.9):
- CapacitorCamera (5.0.10):
- Capacitor
- CapacitorClipboard (5.0.7):
- CapacitorClipboard (5.0.8):
- Capacitor
- CapacitorCommunitySqlite (5.6.1):
- Capacitor
- SQLCipher
- ZIPFoundation
- CapacitorCordova (5.6.0)
- CapacitorFilesystem (5.2.1):
- CapacitorCordova (5.7.8)
- CapacitorFilesystem (5.2.2):
- Capacitor
- CapacitorMlkitBarcodeScanning (5.4.0):
- Capacitor
- GoogleMLKit/BarcodeScanning (= 4.0.0)
- CapacitorPluginSafeArea (2.0.6):
- Capacitor
- CapacitorStatusBar (5.0.7):
- CapacitorStatusBar (5.0.8):
- Capacitor
- CapacitorToast (5.0.7):
- CapacitorToast (5.0.8):
- Capacitor
- GoogleDataTransport (9.2.5):
- GoogleUtilities/Environment (~> 7.7)
Expand Down Expand Up @@ -87,18 +87,18 @@ PODS:
- ZIPFoundation (0.9.16)

DEPENDENCIES:
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
- "CapacitorApp (from `../../node_modules/@capacitor/app`)"
- "CapacitorBrowser (from `../../node_modules/@capacitor/browser`)"
- "CapacitorCamera (from `../../node_modules/@capacitor/camera`)"
- "CapacitorClipboard (from `../../node_modules/@capacitor/clipboard`)"
- "CapacitorCommunitySqlite (from `../../node_modules/@capacitor-community/sqlite`)"
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
- "CapacitorFilesystem (from `../../node_modules/@capacitor/filesystem`)"
- "CapacitorMlkitBarcodeScanning (from `../../node_modules/@capacitor-mlkit/barcode-scanning`)"
- CapacitorPluginSafeArea (from `../../node_modules/capacitor-plugin-safe-area`)
- "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
- "CapacitorToast (from `../../node_modules/@capacitor/toast`)"
- "Capacitor (from `../../../../node_modules/@capacitor/ios`)"
- "CapacitorApp (from `../../../../node_modules/@capacitor/app`)"
- "CapacitorBrowser (from `../../../../node_modules/@capacitor/browser`)"
- "CapacitorCamera (from `../../../../node_modules/@capacitor/camera`)"
- "CapacitorClipboard (from `../../../../node_modules/@capacitor/clipboard`)"
- "CapacitorCommunitySqlite (from `../../../../node_modules/@capacitor-community/sqlite`)"
- "CapacitorCordova (from `../../../../node_modules/@capacitor/ios`)"
- "CapacitorFilesystem (from `../../../../node_modules/@capacitor/filesystem`)"
- "CapacitorMlkitBarcodeScanning (from `../../../../node_modules/@capacitor-mlkit/barcode-scanning`)"
- CapacitorPluginSafeArea (from `../../../../node_modules/capacitor-plugin-safe-area`)
- "CapacitorStatusBar (from `../../../../node_modules/@capacitor/status-bar`)"
- "CapacitorToast (from `../../../../node_modules/@capacitor/toast`)"
- GoogleMLKit/BarcodeScanning

SPEC REPOS:
Expand All @@ -120,43 +120,43 @@ SPEC REPOS:

EXTERNAL SOURCES:
Capacitor:
:path: "../../node_modules/@capacitor/ios"
:path: "../../../../node_modules/@capacitor/ios"
CapacitorApp:
:path: "../../node_modules/@capacitor/app"
:path: "../../../../node_modules/@capacitor/app"
CapacitorBrowser:
:path: "../../node_modules/@capacitor/browser"
:path: "../../../../node_modules/@capacitor/browser"
CapacitorCamera:
:path: "../../node_modules/@capacitor/camera"
:path: "../../../../node_modules/@capacitor/camera"
CapacitorClipboard:
:path: "../../node_modules/@capacitor/clipboard"
:path: "../../../../node_modules/@capacitor/clipboard"
CapacitorCommunitySqlite:
:path: "../../node_modules/@capacitor-community/sqlite"
:path: "../../../../node_modules/@capacitor-community/sqlite"
CapacitorCordova:
:path: "../../node_modules/@capacitor/ios"
:path: "../../../../node_modules/@capacitor/ios"
CapacitorFilesystem:
:path: "../../node_modules/@capacitor/filesystem"
:path: "../../../../node_modules/@capacitor/filesystem"
CapacitorMlkitBarcodeScanning:
:path: "../../node_modules/@capacitor-mlkit/barcode-scanning"
:path: "../../../../node_modules/@capacitor-mlkit/barcode-scanning"
CapacitorPluginSafeArea:
:path: "../../node_modules/capacitor-plugin-safe-area"
:path: "../../../../node_modules/capacitor-plugin-safe-area"
CapacitorStatusBar:
:path: "../../node_modules/@capacitor/status-bar"
:path: "../../../../node_modules/@capacitor/status-bar"
CapacitorToast:
:path: "../../node_modules/@capacitor/toast"
:path: "../../../../node_modules/@capacitor/toast"

SPEC CHECKSUMS:
Capacitor: ebfc16cdb8116d04c101686b080342872da42d43
CapacitorApp: 17fecd0e6cb23feafac7eb0939417389038b0979
CapacitorBrowser: a6deae9e5bf87f62b62a753cff7992c5def9e771
CapacitorCamera: 4892c5c392f60039d853dde78bc50ba19fbd113e
CapacitorClipboard: 45e5e25f2271f98712985d422776cdc5a779cca1
Capacitor: 747aadb4fa786f460d8cd9d0557cb81440a13747
CapacitorApp: 102e553c3b1fdc255969c39aa19b529675690ef4
CapacitorBrowser: bac3132be6506411704149f9f2099843ffe470a0
CapacitorCamera: d333715364b5d85422c627aae6db87ef6161352c
CapacitorClipboard: 03628c89fe70d06d36288ee4eff7e205a6e81e53
CapacitorCommunitySqlite: 47474c9717db7d998eeba2c3147e1c055a726d5f
CapacitorCordova: 931b48fcdbc9bc985fc2f16cec9f77c794a27729
CapacitorFilesystem: 9f3e3c7fea2fff12f46dd5b07a2914f2103e4cfc
CapacitorCordova: 31ab98dca2ddcee051027a1afe7e8c85c82f7297
CapacitorFilesystem: 202b158a878462ab4f401d0eb4d9644c67927333
CapacitorMlkitBarcodeScanning: 8fb81cbef3c6ffe0c0e2dbd15ed6dca889a5a062
CapacitorPluginSafeArea: d55e4d4e70c98f611240f11dd80561438d0d70cb
CapacitorStatusBar: f390fbb49b82ffb754ea4b3cf71dc8b048baf3e7
CapacitorToast: c8bb89eeb59a23c1fc298f138cc06c8ff4d90ac1
CapacitorStatusBar: 51af549cfcf35aac3ab072b062967ae5971ee485
CapacitorToast: 5967ced673b9fb9b7d7b8520c648dbd8f5064b15
GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2
GoogleMLKit: 2bd0dc6253c4d4f227aad460f69215a504b2980e
GoogleToolboxForMac: 8bef7c7c5cf7291c687cf5354f39f9db6399ad34
Expand All @@ -172,6 +172,6 @@ SPEC CHECKSUMS:
SQLCipher: 905b145f65f349f26da9e60a19901ad24adcd381
ZIPFoundation: d170fa8e270b2a32bef9dcdcabff5b8f1a5deced

PODFILE CHECKSUM: d5187453a2e7fe025e8be279069c58f44522b6bc
PODFILE CHECKSUM: b0f792207ce8b0ecb3967796322be793954734f3

COCOAPODS: 1.15.1
6 changes: 3 additions & 3 deletions apps/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"preprocess": "npx madge --circular --extensions ts --extensions tsx .",
"prettify": "prettier --ignore-unknown --write .",
"preview": "vite preview",
"sync:electron": "npm run clean && npm run build && cap sync electron && npx cap update electron && npm run lint",
"sync": "npm run clean && npm run build && npx cap sync && npx cap update && cap sync electron && npx cap update electron && npm run lint",
"sync:electron": "npm run clean && npm run build && cap sync electron && npx cap update electron",
"sync": "npm run clean && npm run build && npx cap sync && npx cap update && cap sync electron && npx cap update electron",
"test": "echo 'no test'",
"coverage": "npm run test -- --coverage"
},
Expand Down Expand Up @@ -56,7 +56,7 @@
"capacitor-plugin-safe-area": "^2.0.6",
"clipboardy": "^4.0.0",
"crypto-js": "^4.2.0",
"ergo-lib-wasm-browser": "^0.28.0",
"ergo-lib-wasm-browser": "0.26.0",
"generate-password": "^1.7.1",
"is-electron": "^2.2.2",
"json-bigint": "^1.0.0",
Expand Down
1 change: 0 additions & 1 deletion apps/wallet/src/hooks/useTransactionData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const useTransactionData = (txId: string, wallet: StateWallet) => {
if (!loading) {
const processingTxId = txId;
if (loadedWalletId !== `${wallet.id}` || txId !== loadedTx) {
console.log(loadedWalletId, loadedTx, txId);
setLoading(true);
const chain = getChain(wallet.networkType);
chain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ const TokenSelect = (props: TokenSelectPropsType) => {
const handleSelectToken = (event: SelectChangeEvent<Array<string>>) => {
const value = event.target.value;
const selected = typeof value === 'string' ? value.split(',') : value;
const newTokens: Array<ReceiverTokenType> = [];
for (const tokenId of selected) {
const filtered = content.tokens.filter((token) => token.id === tokenId);
newTokens.push(
filtered.length > 0 ? filtered[0] : { id: tokenId, amount: 0n },
);
}
const newTokens: Array<ReceiverTokenType> = content.tokens.filter((item) =>
selected.includes(item.id),
);
const oldSelectedIds = newTokens.map((item) => item.id);
selected
.filter((item) => !oldSelectedIds.includes(item))
.forEach((item) => newTokens.push({ id: item, amount: 0n }));
generatorContext.edit(props.index, { tokens: newTokens });
};

Expand Down
6 changes: 1 addition & 5 deletions apps/wallet/src/utils/networks/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ class ErgoExplorerNetwork extends AbstractNetwork {
headers.map((item) => JsonBI.stringify(item)),
);
const pre_header = wasm.PreHeader.from_block_header(blockHeaders.get(0));
return new wasm.ErgoStateContext(
pre_header,
blockHeaders,
wasm.Parameters.default_parameters(),
);
return new wasm.ErgoStateContext(pre_header, blockHeaders);
}
throw Error('Unknown error occurred');
};
Expand Down
6 changes: 1 addition & 5 deletions apps/wallet/src/utils/networks/fakeContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,7 @@ const fakeContext = () => {
const preHeader = wasm.PreHeader.from_block_header(
wasm.BlockHeader.from_json(headers[0]),
);
return new wasm.ErgoStateContext(
preHeader,
blockHeaders,
wasm.Parameters.default_parameters(),
);
return new wasm.ErgoStateContext(preHeader, blockHeaders);
};

export default fakeContext;
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5061533

Please sign in to comment.