Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.1.9 - Uniswap & Auth related Bugfixes #482

Merged
merged 14 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"eslint-plugin-cypress": "2.13.3",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-refresh": "0.4.3",
Expand Down
10 changes: 5 additions & 5 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@alphaday/frontend",
"private": true,
"version": "3.1.8",
"version": "3.1.9",
"type": "module",
"scripts": {
"prepare": "export VITE_COMMIT=$(git rev-parse --short HEAD)",
Expand Down Expand Up @@ -38,14 +38,14 @@
"@web3modal/ethereum": "2.7.1",
"@web3modal/react": "2.7.0",
"chroma-js": "2.4.2",
"dompurify": "3.0.6",
"dompurify": "3.1.7",
"es6-error": "4.1.1",
"firebase": "10.0.0",
"html2canvas": "1.4.1",
"ionicons": "7.3.0",
"md5": "2.3.0",
"moment": "2.29.4",
"query-string": "8.1.0",
"query-string": "9.1.1",
"react": "18.2.0",
"react-beautiful-dnd": "13.1.1",
"react-dom": "18.2.0",
Expand All @@ -57,7 +57,7 @@
"react-redux": "8.0.2",
"react-router": "5.3.4",
"react-router-dom": "5.3.4",
"react-select": "5.7.0",
"react-select": "5.8.1",
"react-super-seo": "1.1.9",
"react-use-audio-player": "AlphadayHQ/useAudioPlayer",
"redux-persist": "6.0.0",
Expand Down Expand Up @@ -93,7 +93,7 @@
"sharp": "0.32.6",
"svgo": "3.2.0",
"terser": "5.30.4",
"vite-plugin-image-optimizer": "1.1.7",
"vite-plugin-image-optimizer": "1.1.8",
"vite-plugin-optimize-css-modules": "1.0.4",
"vite-plugin-pwa": "0.19.2",
"vite-plugin-svgr": "3.2.0"
Expand Down
17 changes: 16 additions & 1 deletion packages/frontend/src/api/hooks/useAppInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@ import {
useGetFeaturesQuery,
useGetSubscribedViewsQuery,
} from "src/api/services";
import * as userStore from "src/api/store/slices/user";
import { useAppDispatch } from "../store/hooks";
import { getRtkErrorCode } from "../utils/errorHandling";
import { Logger } from "../utils/logging";

export const useAppInit: () => void = () => {
/**
* Fetch the features on app load, then we rely on redux cache to
* ensure subsequent calls are cached.
*/
useGetFeaturesQuery();
const dispatch = useAppDispatch();
const { error } = useGetFeaturesQuery();
useGetSubscribedViewsQuery();

if (getRtkErrorCode(error) === 401) {
/**
* If the status check or the subscribed views endpoint gives a 401 unauthorized error,
* we need to reset the auth state and reload the app
*/
Logger.debug("App::AppRoutes: 401 received");
dispatch(userStore.resetAuthState());
location.reload();
}
};
4 changes: 4 additions & 0 deletions packages/frontend/src/components/uniswap/SwapModule.scss
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@
background-color: theme("colors.background");
}

[color="container"]:empty {
display: none;
}

/** Swap warning */
[class*="ErrorView__ExpandoContent"] {
@apply fontGroup-supportBold;
Expand Down
17 changes: 13 additions & 4 deletions packages/frontend/src/mobile-containers/SuperfeedContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,19 @@ const SuperfeedContainer: FC<{
}
}, [tagsFromSearch, setSearchState]);

const keywordOptions = useMemo(
() => groupedKeywordsAsOptions(keywordResults),
[keywordResults]
);
/**
* It's safe to check only coins and chains since the results would mostly be coins and chains
*/
const hasSufficientResults =
(keywordResults?.[ESupportedFilters.Coins] ??
keywordResults?.[ESupportedFilters.Chains]) !== undefined;

const keywordOptions = useMemo(() => {
if (keywordResults !== undefined && hasSufficientResults) {
return groupedKeywordsAsOptions(keywordResults);
}
return [];
}, [keywordResults, hasSufficientResults]);

const initialSearchValues = useMemo(() => {
if (!tagsFromSearch) return undefined;
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"react-markdown": "8.0.7",
"react-quick-pinch-zoom": "5.1.0",
"react-router-dom": "5.3.4",
"react-select": "5.7.0",
"react-select": "5.8.1",
"tailwind-merge": "1.13.2",
"tailwind-variants": "0.2.1",
"url": "0.11.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-kit/src/components/dropdown/SortBy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const SortBy: FC<ISortBy> = ({ selected, onSortBy, options }) => {
>
<Menu.Items className="absolute fontGroup-highlightSemi top-[27px] right-0 z-10 w-40 py-2 origin-top-right bg-backgroundVariant100 rounded-lg border border-borderLine focus:outline-none">
{options.map((option, index) => (
<Menu.Item>
<Menu.Item key={option}>
<span
className={twMerge(
"block hover:bg-backgroundVariant200 py-2 px-2 border-b mx-2 border-borderLine text-primary cursor-pointer",
Expand Down
69 changes: 31 additions & 38 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1350,14 +1350,7 @@
resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310"
integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==

"@babel/runtime@>=7.17.0", "@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.6", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.0", "@babel/runtime@^7.17.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.23.2", "@babel/runtime@^7.24.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
version "7.24.1"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.1.tgz#431f9a794d173b53720e69a6464abc6f0e2a5c57"
integrity sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==
dependencies:
regenerator-runtime "^0.14.0"

"@babel/runtime@^7.23.4":
"@babel/runtime@>=7.17.0", "@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.6", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.0", "@babel/runtime@^7.17.2", "@babel/runtime@^7.18.3", "@babel/runtime@^7.23.2", "@babel/runtime@^7.23.4", "@babel/runtime@^7.24.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
version "7.24.4"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.4.tgz#de795accd698007a66ba44add6cc86542aff1edd"
integrity sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA==
Expand Down Expand Up @@ -8281,10 +8274,10 @@ domhandler@^5.0.2, domhandler@^5.0.3:
dependencies:
domelementtype "^2.3.0"

dompurify@3.0.6:
version "3.0.6"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.0.6.tgz#925ebd576d54a9531b5d76f0a5bef32548351dae"
integrity sha512-ilkD8YEnnGh1zJ240uJsW7AzE+2qpbOUYjacomn3AvJ6J4JhKGSZ2nh4wUIXPZrEPppaCLx5jFe8T89Rk8tQ7w==
dompurify@3.1.7:
version "3.1.7"
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.1.7.tgz#711a8c96479fb6ced93453732c160c3c72418a6a"
integrity sha512-VaTstWtsneJY8xzy7DekmYWEOZcmzIe3Qb3zPd4STve1OBTa+e+WmS1ITQec1fZYXI3HCsOZZiSMpG6oxoWMWQ==

domutils@^3.0.1:
version "3.1.0"
Expand Down Expand Up @@ -8799,13 +8792,13 @@ [email protected]:
object.entries "^1.1.7"
object.fromentries "^2.0.7"

eslint-plugin-prettier@5.1.3:
version "5.1.3"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.1.3.tgz#17cfade9e732cef32b5f5be53bd4e07afd8e67e1"
integrity sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==
eslint-plugin-prettier@5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz#d1c8f972d8f60e414c25465c163d16f209411f95"
integrity sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==
dependencies:
prettier-linter-helpers "^1.0.0"
synckit "^0.8.6"
synckit "^0.9.1"

[email protected]:
version "4.6.0"
Expand Down Expand Up @@ -12800,10 +12793,10 @@ path-type@^4.0.0:
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==

pathe@^1.1.0, pathe@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.1.tgz#1dd31d382b974ba69809adc9a7a347e65d84829a"
integrity sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==
pathe@^1.1.0, pathe@^1.1.1, pathe@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec"
integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==

pathval@^1.1.1:
version "1.1.1"
Expand Down Expand Up @@ -13294,10 +13287,10 @@ [email protected]:
split-on-first "^1.0.0"
strict-uri-encode "^2.0.0"

query-string@8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-8.1.0.tgz#e7f95367737219544cd360a11a4f4ca03836e115"
integrity sha512-BFQeWxJOZxZGix7y+SByG3F36dA0AbTy9o6pSmKFcFz7DAj0re9Frkty3saBn3nHo3D0oZJ/+rx3r8H8r8Jbpw==
query-string@9.1.1:
version "9.1.1"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-9.1.1.tgz#dbfebb4196aeb2919915f2b2b81b91b965cf03a0"
integrity sha512-MWkCOVIcJP9QSKU52Ngow6bsAWAPlPK2MludXvcrS2bGZSl+T1qX9MZvRIkqUIkGLJquMJHWfsT6eRqUpp4aWg==
dependencies:
decode-uri-component "^0.4.1"
filter-obj "^5.1.0"
Expand Down Expand Up @@ -13603,10 +13596,10 @@ [email protected]:
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-select@5.7.0:
version "5.7.0"
resolved "https://registry.yarnpkg.com/react-select/-/react-select-5.7.0.tgz#82921b38f1fcf1471a0b62304da01f2896cd8ce6"
integrity sha512-lJGiMxCa3cqnUr2Jjtg9YHsaytiZqeNOKeibv6WF5zbK/fPegZ1hg3y/9P1RZVLhqBTs0PfqQLKuAACednYGhQ==
react-select@5.8.1:
version "5.8.1"
resolved "https://registry.yarnpkg.com/react-select/-/react-select-5.8.1.tgz#3284a93b7633b5e893306b2a8007ea0f793e62b9"
integrity sha512-RT1CJmuc+ejqm5MPgzyZujqDskdvB9a9ZqrdnVLsvAHjJ3Tj0hELnLeVPQlmYdVKCdCpxanepl6z7R5KhXhWzg==
dependencies:
"@babel/runtime" "^7.12.0"
"@emotion/cache" "^11.4.0"
Expand Down Expand Up @@ -15193,10 +15186,10 @@ swarm-js@^0.1.40:
tar "^4.0.2"
xhr-request "^1.0.1"

synckit@^0.8.6:
version "0.8.8"
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.8.tgz#fe7fe446518e3d3d49f5e429f443cf08b6edfcd7"
integrity sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==
synckit@^0.9.1:
version "0.9.2"
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.9.2.tgz#a3a935eca7922d48b9e7d6c61822ee6c3ae4ec62"
integrity sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==
dependencies:
"@pkgr/core" "^0.1.0"
tslib "^2.6.2"
Expand Down Expand Up @@ -16248,13 +16241,13 @@ [email protected]:
picocolors "^1.0.0"
vite "^3.0.0 || ^4.0.0"

[email protected].7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/vite-plugin-image-optimizer/-/vite-plugin-image-optimizer-1.1.7.tgz#8513e9edcbdfecd6202759095e04d13521c9bbd5"
integrity sha512-KPJWndwqVi7Z2hYCudzKeNDw5U7w1DxAc266bqDBKV8taG8W3EtripFuUM4Y05IlFC19yBQndJCFA8+NJymH+w==
[email protected].8:
version "1.1.8"
resolved "https://registry.yarnpkg.com/vite-plugin-image-optimizer/-/vite-plugin-image-optimizer-1.1.8.tgz#5244a34fa608513b36c0b525b6726fb858e8d19c"
integrity sha512-40bYRDHQLUOrIwJIJQqyKJHrfgVshqzDLtMy8SEgf+fB7PnppslSTTkY7PJFrBGqgbCdOdN9KkqsvccXmnEa5Q==
dependencies:
ansi-colors "^4.1.3"
pathe "^1.1.1"
pathe "^1.1.2"

[email protected]:
version "1.0.4"
Expand Down
Loading