From bd4c461155ecbb5f6d79f5b9bc55139604dde0f0 Mon Sep 17 00:00:00 2001 From: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:25:10 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=9B=91=20Stop=20polling=20if=20notifi?= =?UTF-8?q?cations=20recipient=20is=20undefined=20(#5695)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/providers/notifications/notifications.hooks.ts | 2 ++ .../src/providers/notifications/notifications.manager.tsx | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/atlas/src/providers/notifications/notifications.hooks.ts b/packages/atlas/src/providers/notifications/notifications.hooks.ts index 782d2467ed..564b31df69 100644 --- a/packages/atlas/src/providers/notifications/notifications.hooks.ts +++ b/packages/atlas/src/providers/notifications/notifications.hooks.ts @@ -32,6 +32,7 @@ export type UseNotifications = Pick setLastSeenNotificationDate: (data: Date) => void markNotificationsAsRead: (notifications: NotificationRecord[]) => void pageInfo?: GetNotificationsConnectionQuery['notificationsConnection']['pageInfo'] + recipient: RecipientTypeWhereInput | undefined } export const useNotifications = (opts?: Pick): UseNotifications => { @@ -120,6 +121,7 @@ export const useNotifications = (opts?: Pick { - const { fetchMore, unseenNotificationsCounts } = useNotifications() + const { fetchMore, unseenNotificationsCounts, recipient } = useNotifications() useEffect(() => { const id = setInterval(() => { + if (!recipient) { + return + } + unseenNotificationsCounts.fetchMore() fetchMore({ updateQuery: (prev, { fetchMoreResult }) => { @@ -44,7 +48,7 @@ export const NotificationsManager: FC = () => { clearInterval(id) } // eslint-disable-next-line react-hooks/exhaustive-deps - }, [fetchMore, unseenNotificationsCounts.fetchMore]) + }, [fetchMore, unseenNotificationsCounts.fetchMore, !recipient]) return null } From 6e0d0b5ef539fa234d004464eaddc3d47f837270 Mon Sep 17 00:00:00 2001 From: WRadoslaw <92513933+WRadoslaw@users.noreply.github.com> Date: Wed, 27 Dec 2023 13:26:18 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=BB=E2=80=8D=E2=9D=84=EF=B8=8F=20C?= =?UTF-8?q?onsider=20only=20polkadot=20accounts=20from=20wallet=20(#5696)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/providers/wallet/wallet.provider.tsx | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/atlas/src/providers/wallet/wallet.provider.tsx b/packages/atlas/src/providers/wallet/wallet.provider.tsx index d4e0efbfda..2e441567f8 100644 --- a/packages/atlas/src/providers/wallet/wallet.provider.tsx +++ b/packages/atlas/src/providers/wallet/wallet.provider.tsx @@ -29,7 +29,10 @@ export const WalletProvider: FC = ({ children }) => { const setWalletAccounts = useCallback( async (accounts: WalletAccount[]) => { - const mappedAccounts = accounts.map((account) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const polkadotAccounts = accounts.filter((account: any) => account.type === 'sr25519') + + const mappedAccounts = polkadotAccounts.map((account) => { return { ...account, address: formatJoystreamAddress(account.address), @@ -56,16 +59,17 @@ export const WalletProvider: FC = ({ children }) => { // taken from https://github.com/TalismanSociety/talisman-connect/blob/47cfefee9f1333326c0605c159d6ee8ebfba3e84/libs/wallets/src/lib/base-dotsama-wallet/index.ts#L98-L107 // should be part of future talisman-connect release const accounts = await selectedWallet.extension.accounts.get() - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const accountsWithWallet = accounts.map((account: any) => { - return { - ...account, - address: formatJoystreamAddress(account.address), - source: selectedWallet.extension?.name as string, - wallet: selectedWallet, - signer: selectedWallet.extension?.signer, - } - }) + const accountsWithWallet = accounts + // eslint-disable-next-line @typescript-eslint/no-explicit-any + .map((account: any) => { + return { + ...account, + address: account.address, + source: selectedWallet.extension?.name as string, + wallet: selectedWallet, + signer: selectedWallet.extension?.signer, + } + }) setWalletAccounts(accountsWithWallet) setWallet(selectedWallet) From c409820bbd89eed082d18d21b7a1d68269c9efdf Mon Sep 17 00:00:00 2001 From: WRadoslaw Date: Fri, 29 Dec 2023 13:44:51 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=E2=AC=86=EF=B8=8FBump=20version=20and=20ad?= =?UTF-8?q?just=20changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 11 +++++++++-- packages/atlas/package.json | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edda2071f1..b91332efd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [4.14.3] - 2023-12-08 +## [4.14.5] - 2023-12-29 + +### Fixed + +- Fixed wallet problems when injecting ethereum addresses +- Removed notification polling for anonymous users + +## [4.14.4] - 2023-12-08 ### Fixed - Fixed atlas meta server query -- Fiex basic channel query performance +- Fixed basic channel query performance ## [4.14.3] - 2023-12-08 diff --git a/packages/atlas/package.json b/packages/atlas/package.json index c3bd158547..9d3151a47a 100644 --- a/packages/atlas/package.json +++ b/packages/atlas/package.json @@ -1,7 +1,7 @@ { "name": "@joystream/atlas", "description": "UI for consuming Joystream - a user governed video platform", - "version": "4.14.4", + "version": "4.14.5", "license": "GPL-3.0", "scripts": { "start": "vite",