Skip to content

Commit a979d69

Browse files
v4.2.4
1 parent 4b71fd3 commit a979d69

File tree

30 files changed

+139
-39
lines changed

30 files changed

+139
-39
lines changed

changelogs/4.2.4.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bug fixes and performance improvements

mobile/android/air/SubModules/Ledger/src/main/java/org/mytonwallet/app_air/ledger/connectionManagers/LedgerBleManager.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ object LedgerBleManager : ILedgerConnectionManager {
9595
) {
9696
Handler(Looper.getMainLooper()).post {
9797
WalletCore.call(
98-
ApiMethod.Other.WaitForLedgerApp(chain = MBlockchain.ton),
98+
ApiMethod.Other.WaitForLedgerApp(
99+
chain = MBlockchain.ton,
100+
ApiMethod.Other.WaitForLedgerApp.Options(timeout = 2000)
101+
),
99102
callback = { res, error ->
100103
if (res != true || error != null) {
101104
onUpdate(

mobile/android/air/SubModules/WalletCore/src/main/java/org/mytonwallet/app_air/walletcore/moshi/api/ApiMethod.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,19 @@ sealed class ApiMethod<T> {
4848
.build()
4949
}
5050

51-
class WaitForLedgerApp(chain: MBlockchain) : ApiMethod<Boolean>() {
51+
class WaitForLedgerApp(chain: MBlockchain, options: Options? = null) :
52+
ApiMethod<Boolean>() {
53+
@JsonClass(generateAdapter = true)
54+
data class Options(
55+
val timeout: Int? = null,
56+
val attemptPause: Int? = null
57+
)
58+
5259
override val name: String = "waitForLedgerApp"
5360
override val type: Type = Boolean::class.java
5461
override val arguments: String = ArgumentsBuilder()
5562
.string(chain.name)
63+
.jsObject(options, Options::class.java)
5664
.build()
5765
}
5866
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mytonwallet",
3-
"version": "4.2.3",
3+
"version": "4.2.4",
44
"description": "The most feature-rich web wallet and browser extension for TON – with support of multi-accounts, tokens (jettons), NFT, TON DNS, TON Sites, TON Proxy, and TON Magic.",
55
"main": "index.js",
66
"scripts": {

public/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2.3
1+
4.2.4

src/components/common/TokenSelector.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ interface OwnProps {
6868
shouldUseSwapTokens?: boolean;
6969
shouldHideMyTokens?: boolean;
7070
shouldHideNotSupportedTokens?: boolean;
71+
isSwapOut?: boolean;
7172
selectedChain?: ApiChain | ApiChain[];
7273
header?: TeactNode;
7374
onClose: NoneToVoidFunction;
@@ -513,12 +514,12 @@ function TokenSelector({
513514
);
514515
}
515516

516-
export default memo(withGlobal<OwnProps>((global): StateProps => {
517+
export default memo(withGlobal<OwnProps>((global, ownProps): StateProps => {
517518
const { baseCurrency, isSensitiveDataHidden } = global.settings;
518519
const { isLoading, token } = global.settings.importToken ?? {};
519520
const { tokenInSlug, shouldShowAllPairs } = global.currentSwap ?? {};
520521
const pairsBySlug = global.swapPairs?.bySlug;
521-
const userTokens = selectAvailableUserForSwapTokens(global);
522+
const userTokens = selectAvailableUserForSwapTokens(global, ownProps.isSwapOut);
522523
const popularTokens = selectPopularTokens(global);
523524
const swapTokens = selectSwapTokens(global);
524525
const isMultichain = selectIsMultichainAccount(global, global.currentAccountId!);

src/components/main/modals/OnRampWidgetModal.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ function OnRampWidgetModal({
6060

6161
const dropdownItems = useMemo<DropdownItem<ApiBaseCurrency>[]>(
6262
() => Object.entries(CURRENCIES)
63-
.filter(([currency]) => SUPPORTED_CURRENCIES.has(currency as ApiBaseCurrency))
63+
.filter(([currency]) => {
64+
return SUPPORTED_CURRENCIES.has(currency as ApiBaseCurrency) && (chain !== 'tron' || currency !== 'RUB');
65+
})
6466
.map(([currency, { name }]) => ({ value: currency as ApiBaseCurrency, name })),
65-
[],
67+
[chain],
6668
);
6769

6870
useEffect(() => {
@@ -89,11 +91,8 @@ function OnRampWidgetModal({
8991
const cardType = getCardType(chain, selectedCurrency);
9092

9193
if (cardType === 'avanchange') {
92-
if (chain === 'ton') {
93-
setIframeSrc(buildAvanchangeUrl(address));
94-
} else {
95-
handleError(lang('Purchasing TRON with Russian Rubles is currently unavailable.'));
96-
}
94+
setIframeSrc(buildAvanchangeUrl(address));
95+
9796
return;
9897
}
9998

src/components/main/sections/Header/AccountSelector.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ $iconGapSize: 1rem;
150150

151151
&_compact {
152152
grid-template-columns: 1fr 1fr;
153-
max-width: calc(66% + 1rem);
153+
max-width: 15rem;
154154
}
155155

156156
.container:global(.closing) > & {

src/components/swap/SwapModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ function SwapModal({
273273
isActive={isActive}
274274
shouldUseSwapTokens
275275
shouldFilter={currentKey === SwapState.SelectTokenTo}
276+
isSwapOut={currentKey === SwapState.SelectTokenTo}
276277
onTokenSelect={handleTokenSelect}
277278
onBack={handleBackClick}
278279
onClose={handleModalCloseWithReset}

0 commit comments

Comments
 (0)