Skip to content

Commit

Permalink
v3.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mytonwalletorg committed Aug 11, 2024
1 parent 6ba51cb commit 3129839
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 43 deletions.
1 change: 1 addition & 0 deletions changelogs/3.0.6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bug fixes and performance improvements
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mytonwallet",
"version": "3.0.5",
"version": "3.0.6",
"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.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.5
3.0.6
4 changes: 2 additions & 2 deletions src/components/dapps/DappTransferInitial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ function DappTransferInitial({

const token = tokens?.find(({ slug }) => tokenSlug === slug);
if (token) {
const { decimals, symbol } = token;
const { decimals, symbol, priceUsd } = token;
const tokenAmountDecimal = toDecimal(tokenAmount, decimals);

acc[symbol] = (acc[symbol] ?? Big(0)).plus(tokenAmountDecimal);
cost += Number(amountDecimal) * tonToken.priceUsd;
cost += Number(tokenAmountDecimal) * priceUsd;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ $tab-1-height: 348;
background-color: var(--color-background-purple-2) !important;
}

&_purpleText {
color: var(--color-purple-1);
}

&.active + & {
.tabDelimiter {
display: none;
Expand Down
1 change: 1 addition & 0 deletions src/components/main/sections/Actions/LandscapeActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function LandscapeActions({
styles.tab,
activeTabIndex === ActiveTab.Stake && styles.active,
isStaking && styles.tab_purple,
(hasStaking || isUnstakeRequested) && styles.tab_purpleText,
)}
onClick={() => handleSelectTab(ActiveTab.Stake)}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/sections/Actions/PortraitActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function PortraitActions({
)}
{isStakingAllowed && (
<Button
className={buildClassName(styles.button, hasStaking && styles.button_purple)}
className={buildClassName(styles.button, (hasStaking || isUnstakeRequested) && styles.button_purple)}
onClick={handleEarnClick}
isSimple
>
Expand Down
16 changes: 6 additions & 10 deletions src/components/main/sections/Content/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,12 @@ function Content({
});
}, [lang, nfts, blacklistedNftAddresses, whitelistedNftAddresses]);

const hiddenByUserNfts = useMemo(() => {
const blacklistedNftAddressesSet = new Set(blacklistedNftAddresses);
return Object.values(nfts ?? {}).filter((nft) => blacklistedNftAddressesSet.has(nft.address));
}, [nfts, blacklistedNftAddresses]);

const probablyScamNfts = useMemo(() => {
return Object.values(nfts ?? {}).filter((nft) => nft.isHidden);
}, [nfts]);

const shouldRenderHiddenNftsSection = hiddenByUserNfts.length > 0 || probablyScamNfts.length > 0;
const shouldRenderHiddenNftsSection = useMemo(() => {
const blacklistedAddressesSet = new Set(blacklistedNftAddresses);
return Object.values(nfts ?? {}).some(
(nft) => blacklistedAddressesSet.has(nft.address) || nft.isHidden,
);
}, [blacklistedNftAddresses, nfts]);

// eslint-disable-next-line no-null/no-null
const transitionRef = useRef<HTMLDivElement>(null);
Expand Down
21 changes: 11 additions & 10 deletions src/components/mediaViewer/MediaViewer.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,17 @@
align-items: center;

height: 100%;
padding: 6rem 0 2rem;
padding: 4rem 0 2rem;

&::before {
content: "";

display: block;
flex: 1;
}

@include respond-below(xs) {
padding: 3rem 0 0.5rem;
&::before {
content: "";

display: block;
flex: 1;
}
}
}

Expand All @@ -256,15 +257,15 @@
--max-height: 4.25rem;
--background-color: #202020;

overflow: auto;
flex: 1;

max-width: min(50rem, calc(100% - 4rem));
margin-top: 2rem;

@include respond-below(xs) {
--background-color: #000;

overflow: auto;
flex: 1;

max-width: 100%;
margin-top: 0.5rem;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/mediaViewer/helpers/ghostAnimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function animateOpening(
const { width: mediaWidth, height: mediaHeight } = await getImageDimension(mediaUrl);

const availableHeight = windowHeight - OCCUPIED_HEIGHT;
const offsetTop = (windowWidth <= MOBILE_SCREEN_MAX_WIDTH ? 8 : 6) * REM;
const offsetTop = (windowWidth <= MOBILE_SCREEN_MAX_WIDTH ? 8 : 7) * REM;

const { width: toWidth, height: toHeight } = calculateDimensions(
windowWidth,
Expand Down
23 changes: 17 additions & 6 deletions src/components/settings/SettingsAssets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
} from '../../config';
import { selectCurrentAccountState } from '../../global/selectors';
import buildClassName from '../../util/buildClassName';
import { MEMO_EMPTY_ARRAY } from '../../util/memo';

import useHistoryBack from '../../hooks/useHistoryBack';
import useLang from '../../hooks/useLang';
Expand Down Expand Up @@ -44,6 +45,7 @@ interface OwnProps {
interface StateProps {
nftsByAddress?: Record<string, ApiNft>;
blacklistedNftAddresses: string[];
whitelistedNftAddresses: string[];
}

function SettingsAssets({
Expand All @@ -59,6 +61,7 @@ function SettingsAssets({
baseCurrency,
nftsByAddress,
blacklistedNftAddresses,
whitelistedNftAddresses,
}: OwnProps & StateProps) {
const {
toggleTinyTransfersHidden,
Expand Down Expand Up @@ -117,14 +120,18 @@ function SettingsAssets({
hiddenNftsCount,
} = useMemo(() => {
const nfts = Object.values(nftsByAddress || {});
const blacklistedNftAddressesSet = new Set(blacklistedNftAddresses);
const hiddenNfts = new Set(nfts.filter((nft) => blacklistedNftAddressesSet.has(nft.address) || nft.isHidden));
const blacklistedAddressesSet = new Set(blacklistedNftAddresses);
const whitelistedAddressesSet = new Set(whitelistedNftAddresses);
const shouldRender = nfts.some((nft) => blacklistedAddressesSet.has(nft.address) || nft.isHidden);
const hiddenNfts = nfts.filter(
(nft) => !whitelistedAddressesSet.has(nft.address) && (blacklistedAddressesSet.has(nft.address) || nft.isHidden),
);

return {
shouldRenderHiddenNftsSection: Boolean(hiddenNfts.size),
hiddenNftsCount: hiddenNfts.size,
shouldRenderHiddenNftsSection: shouldRender,
hiddenNftsCount: hiddenNfts.length,
};
}, [nftsByAddress, blacklistedNftAddresses]);
}, [nftsByAddress, blacklistedNftAddresses, whitelistedNftAddresses]);

return (
<div className={styles.slide}>
Expand Down Expand Up @@ -262,11 +269,15 @@ function SettingsAssets({
}

export default memo(withGlobal<OwnProps>((global): StateProps => {
const { blacklistedNftAddresses = [] } = selectCurrentAccountState(global) || {};
const {
blacklistedNftAddresses = MEMO_EMPTY_ARRAY,
whitelistedNftAddresses = MEMO_EMPTY_ARRAY,
} = selectCurrentAccountState(global) || {};
const { byAddress } = selectCurrentAccountState(global)?.nfts || {};

return {
nftsByAddress: byAddress,
blacklistedNftAddresses,
whitelistedNftAddresses,
};
})(SettingsAssets));
12 changes: 7 additions & 5 deletions src/components/staking/Staking.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,13 @@
padding: 0 1rem 1rem;

border-radius: var(--border-radius-default);

@include respond-below(xs) {
:global(.is-android) & {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}
}

&:global(.staking-info) {
Expand All @@ -358,11 +365,6 @@
border-radius: var(--border-radius-default) 0 var(--border-radius-default) var(--border-radius-default);
}
}

:global(.is-android) & {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}

@include respond-below(xs) {
Expand Down
8 changes: 5 additions & 3 deletions src/components/vesting/VestingModal.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@
background-image: url("../../assets/vesting_bg_dark.png");
}

:global(.is-android) & {
border-top-left-radius: 0;
border-top-right-radius: 0;
@include respond-below(xs) {
:global(.is-android) & {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}

@media (min-resolution: 1.5dppx) {
Expand Down
9 changes: 8 additions & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ const canUseStatoscope = !IS_EXTENSION && !IS_PACKAGED_ELECTRON && !IS_CAPACITOR
const cspConnectSrcExtra = APP_ENV === 'development'
? `http://localhost:3000 ${process.env.CSP_CONNECT_SRC_EXTRA_URL}`
: '';
const cspFrameSrcExtra = [
'https://widget.changelly.com/',
'https://dreamwalkers.io/',
'https://avanchange.com/',
'https://pay.wata.pro/',
'https://royalpay.cc/',
].join(' ');

// The `connect-src` rule contains `https:` due to arbitrary requests are needed for jetton JSON configs.
// The `img-src` rule contains `https:` due to arbitrary image URLs being used as jetton logos.
Expand All @@ -59,7 +66,7 @@ const CSP = `
base-uri 'none';
font-src 'self' https://fonts.gstatic.com/;
form-action 'none';
frame-src 'self' https://widget.changelly.com/ https://dreamwalkers.io/ https://avanchange.com/ https://pay.wata.pro/`
frame-src 'self' ${cspFrameSrcExtra};`
.replace(/\s+/g, ' ').trim();

const appVersion = require('./package.json').version;
Expand Down

0 comments on commit 3129839

Please sign in to comment.