Skip to content

Commit

Permalink
馃煟 Release 4.14.5
Browse files Browse the repository at this point in the history
Merge pull request #5713 from WRadoslaw/release/4.14.5
  • Loading branch information
WRadoslaw committed Dec 29, 2023
2 parents 896a057 + c409820 commit 0efb8ce
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 16 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/atlas/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type UseNotifications = Pick<QueryResult<GetNotificationsConnectionQuery>
setLastSeenNotificationDate: (data: Date) => void
markNotificationsAsRead: (notifications: NotificationRecord[]) => void
pageInfo?: GetNotificationsConnectionQuery['notificationsConnection']['pageInfo']
recipient: RecipientTypeWhereInput | undefined
}

export const useNotifications = (opts?: Pick<QueryHookOptions, 'notifyOnNetworkStatusChange'>): UseNotifications => {
Expand Down Expand Up @@ -120,6 +121,7 @@ export const useNotifications = (opts?: Pick<QueryHookOptions, 'notifyOnNetworkS
unseenNotificationsCounts,
setLastSeenNotificationDate,
markNotificationsAsRead,
recipient,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ import { atlasConfig } from '@/config'
import { useNotifications } from './notifications.hooks'

export const NotificationsManager: FC = () => {
const { fetchMore, unseenNotificationsCounts } = useNotifications()
const { fetchMore, unseenNotificationsCounts, recipient } = useNotifications()

useEffect(() => {
const id = setInterval(() => {
if (!recipient) {
return
}

unseenNotificationsCounts.fetchMore()
fetchMore({
updateQuery: (prev, { fetchMoreResult }) => {
Expand Down Expand Up @@ -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
}
26 changes: 15 additions & 11 deletions packages/atlas/src/providers/wallet/wallet.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export const WalletProvider: FC<PropsWithChildren> = ({ 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),
Expand All @@ -56,16 +59,17 @@ export const WalletProvider: FC<PropsWithChildren> = ({ 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)
Expand Down

0 comments on commit 0efb8ce

Please sign in to comment.