Skip to content

Commit

Permalink
馃煟 Release 4.14.6
Browse files Browse the repository at this point in the history
Merge pull request #5759 from WRadoslaw/release/4.14.6
  • Loading branch information
WRadoslaw committed Jan 12, 2024
2 parents 0efb8ce + 7081685 commit 35d064d
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 10 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ 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.6] - 2024-01-12

### Fixed

- Fixed user geolocation on viewer side
- Fixed embedded view on mobile devices

### Changed

- Changed YPP opt out error message to include API message, for better UX.

## [4.14.5] - 2023-12-29

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion packages/atlas-meta-server/src/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const generateCommonMetaTags = (
}),
...(image && {
'og:image': image,
'twitter:image': appUrl + image,
'twitter:image': image,
'og:image:alt': title,
'twitter:image:alt': title,
'og:image:type': 'image/webp',
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.5",
"version": "4.14.6",
"license": "GPL-3.0",
"scripts": {
"start": "vite",
Expand Down
9 changes: 6 additions & 3 deletions packages/atlas/src/embedded/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { OperatorsContextProvider } from '@/providers/assets/assets.provider'
import { handleAnonymousAuth } from '@/providers/auth/auth.helpers'
import { useAuthStore } from '@/providers/auth/auth.store'
import { ConfirmationModalProvider } from '@/providers/confirmationModal'
import { OverlayManagerProvider } from '@/providers/overlayManager'
import { SegmentAnalyticsProvider } from '@/providers/segmentAnalytics/segment.provider'
import { GlobalStyles } from '@/styles'
import { EmbeddedView } from '@/views/viewer/EmbeddedView'
Expand Down Expand Up @@ -57,9 +58,11 @@ export const EmbeddedCommonProviders: FC<PropsWithChildren> = ({ children }) =>
<QueryClientProvider client={queryClient}>
<AnonymousEmbeddedProvider>
<ConfirmationModalProvider>
<BrowserRouter>
<OperatorsContextProvider>{children}</OperatorsContextProvider>
</BrowserRouter>
<OverlayManagerProvider>
<BrowserRouter>
<OperatorsContextProvider>{children}</OperatorsContextProvider>
</BrowserRouter>
</OverlayManagerProvider>
</ConfirmationModalProvider>
</AnonymousEmbeddedProvider>
</QueryClientProvider>
Expand Down
4 changes: 4 additions & 0 deletions packages/atlas/src/providers/assets/assets.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ export const OperatorsContextProvider: FC<PropsWithChildren> = ({ children }) =>
fetchStorageOperators()
}, [fetchStorageOperators, isStudio])

useMountEffect(() => {
getUserCoordinates()
})

useMountEffect(() => {
const initBenchmark = async () => {
const thumbnail = benchmarkData?.videos
Expand Down
3 changes: 3 additions & 0 deletions packages/atlas/src/providers/wallet/wallet.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const getWalletsList = () => {
return [...supportedWallets, ...unknownWallets]
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const filterUnsupportedAccounts = (account: any) => account.type === 'sr25519'

export class UnknownWallet extends BaseDotsamaWallet {
extensionName: string
title: string
Expand Down
9 changes: 5 additions & 4 deletions packages/atlas/src/providers/wallet/wallet.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { formatJoystreamAddress } from '@/utils/address'
import { SentryLogger } from '@/utils/logs'
import { retryWalletPromise } from '@/utils/misc'

import { getWalletsList } from './wallet.helpers'
import { filterUnsupportedAccounts, getWalletsList } from './wallet.helpers'

const WalletContext = createContext<undefined | WalletContextValue>(undefined)
WalletContext.displayName = 'WalletContext'
Expand All @@ -29,8 +29,7 @@ export const WalletProvider: FC<PropsWithChildren> = ({ children }) => {

const setWalletAccounts = useCallback(
async (accounts: WalletAccount[]) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const polkadotAccounts = accounts.filter((account: any) => account.type === 'sr25519')
const polkadotAccounts = accounts.filter(filterUnsupportedAccounts)

const mappedAccounts = polkadotAccounts.map((account) => {
return {
Expand Down Expand Up @@ -59,12 +58,14 @@ 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()

const accountsWithWallet = accounts
.filter(filterUnsupportedAccounts)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
.map((account: any) => {
return {
...account,
address: account.address,
address: formatJoystreamAddress(account.address),
source: selectedWallet.extension?.name as string,
wallet: selectedWallet,
signer: selectedWallet.extension?.signer,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { isAxiosError } from 'axios'
import { useCallback, useEffect, useState } from 'react'
import { useMutation } from 'react-query'
import { useNavigate } from 'react-router'
Expand Down Expand Up @@ -228,8 +229,17 @@ export const YppDashboardSettingsTab = () => {
})
return
}

SentryLogger.error('Error while opting out: ', e)

if (isAxiosError(e)) {
displaySnackbar({
title: 'Something went wrong',
description: e.response?.data?.message ?? 'Failed to leave the program. Try again later',
iconType: 'error',
})
return
}

displaySnackbar({
title: 'Something went wrong',
description: 'Failed to leave the program. Try again later',
Expand Down

0 comments on commit 35d064d

Please sign in to comment.