Skip to content

Commit

Permalink
🟣 Release 4.15.1
Browse files Browse the repository at this point in the history
Merge pull request #5913 from WRadoslaw/release/4.15.1
  • Loading branch information
WRadoslaw committed Feb 22, 2024
2 parents 9590c16 + 173ae56 commit e209fdb
Show file tree
Hide file tree
Showing 26 changed files with 306 additions and 59 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ 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.15.1] - 2024-02-22

## Added

- Page for curators
- Video preloading for homepage and video view

### Fixed

- Failing guest auth request in certain scenarios
- Asset URL is now properly cached

### Changed

- Storage operator blacklisting logic on asset upload

## [4.15.0] - 2024-02-09

## Added
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.15.0",
"version": "4.15.1",
"license": "GPL-3.0",
"scripts": {
"start": "vite",
Expand Down

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

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

23 changes: 22 additions & 1 deletion packages/atlas/src/api/queries/__generated__/nfts.generated.tsx

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

28 changes: 28 additions & 0 deletions packages/atlas/src/api/queries/__generated__/videos.generated.tsx

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

8 changes: 8 additions & 0 deletions packages/atlas/src/api/queries/fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ fragment BasicVideoFields on Video {
duration
reactionsCount
commentsCount
media {
id
isAccepted
storageBag {
id
}
resolvedUrls
}
channel {
...BasicChannelFields
}
Expand Down
2 changes: 1 addition & 1 deletion packages/atlas/src/api/schemas/orion.json

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions packages/atlas/src/components/_auth/SignUpModal/SignUpModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export const SignUpModal = () => {
const setYppModalOpenName = useYppStore((state) => state.actions.setYppModalOpenName)
const setYtResponseData = useYppStore((state) => state.actions.setYtResponseData)
const referrerChannelId = useYppStore((state) => state.referrerId)
const { anonymousUserId } = useAuthStore()
const {
anonymousUserId,
actions: { setAnonymousUserId },
} = useAuthStore()
const { displaySnackbar } = useSnackbar()

const { generateUniqueMemberHandleBasedOnInput } = useUniqueMemberHandle()
Expand Down Expand Up @@ -141,8 +144,16 @@ export const SignUpModal = () => {
if (error === RegisterError.SessionRequired) {
if (!haveTriedCreateSession.current) {
haveTriedCreateSession.current = true
handleAnonymousAuth(anonymousUserId).then(() => {
handleOrionAccountCreation()
const anonymousReq = (id: string | null) =>
handleAnonymousAuth(id).then((userId) => {
setAnonymousUserId(userId ?? null)
handleOrionAccountCreation()
})
anonymousReq(anonymousUserId).catch((e) => {
if (e.response.status === 401) {
setAnonymousUserId(null)
anonymousReq(null)
}
})
} else {
displaySnackbar({
Expand Down Expand Up @@ -176,6 +187,7 @@ export const SignUpModal = () => {
goToNextStep,
goToStep,
referrerChannelId,
setAnonymousUserId,
setAuthModalOpenName,
setYppModalOpenName,
setYtResponseData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { SvgActionLinkUrl, SvgIllustrativePlay } from '@/assets/icons'
import { Pill } from '@/components/Pill'
import { absoluteRoutes } from '@/config/routes'
import { useClipboard } from '@/hooks/useClipboard'
import { useVideoPreload } from '@/hooks/useVideoPreload'
import { useVideoTileSharedLogic } from '@/hooks/useVideoTileSharedLogic'
import { SentryLogger } from '@/utils/logs'
import { formatDurationShort } from '@/utils/time'
Expand All @@ -19,15 +20,24 @@ type VideoTileViewerProps = {
detailsVariant?: VideoDetailsVariant
direction?: 'vertical' | 'horizontal'
className?: string
prefetch?: boolean
}

export const VideoTileViewer: FC<VideoTileViewerProps> = ({ id, onClick, detailsVariant, direction, className }) => {
export const VideoTileViewer: FC<VideoTileViewerProps> = ({
id,
onClick,
prefetch,
detailsVariant,
direction,
className,
}) => {
const navigate = useNavigate()
const { video, loading } = useBasicVideo(id ?? '', {
skip: !id,
onError: (error) => SentryLogger.error('Failed to fetch video', 'VideoTile', error, { video: { id } }),
})
const { copyToClipboard } = useClipboard()
useVideoPreload(prefetch ? video?.media?.resolvedUrls : undefined)

const { avatarPhotoUrls, isLoadingAvatar, isLoadingThumbnail, thumbnailPhotoUrls, videoHref } =
useVideoTileSharedLogic(video)
Expand Down
6 changes: 1 addition & 5 deletions packages/atlas/src/config/contentFilter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ChannelWhereInput, VideoWhereInput } from '@/api/queries/__generated__/baseTypes.generated'
import { atlasConfig } from '@/config/config'

export const publicChannelFilter: ChannelWhereInput = {
isCensored_eq: false,
Expand All @@ -17,15 +16,12 @@ export const cancelledVideoFilter: VideoWhereInput = {
},
}

const browserLanguage = navigator.language.split('-')[0]
const browserLanguage = navigator.language?.split('-')[0]

export const publicCryptoVideoFilter: VideoWhereInput = {
isPublic_eq: true,
isCensored_eq: false,
orionLanguage_in: [...(browserLanguage ? [browserLanguage] : []), 'en'],
category: {
id_in: atlasConfig.content.categories.map((category) => category.videoCategories).flat(),
},
media: {
isAccepted_eq: true,
},
Expand Down
1 change: 1 addition & 0 deletions packages/atlas/src/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const relativeRoutes = {
video: (id = ':id') => `video/${id}`,
},
viewer: {
curatorView: () => 'curator-view',
index: () => '',
signin: () => 'signin',
discover: () => 'discover',
Expand Down
12 changes: 10 additions & 2 deletions packages/atlas/src/embedded/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@ const AnonymousEmbeddedProvider = ({ children }: PropsWithChildren) => {
const init = async () => {
const { data } = await lazyCurrentAccountQuery()
if (!data) {
handleAnonymousAuth(anonymousUserId).then((userId) => {
setAnonymousUserId(userId ?? null)
const anonymousReq = (id: string | null) =>
handleAnonymousAuth(id).then((userId) => {
setAnonymousUserId(userId ?? null)
})

anonymousReq(anonymousUserId).catch((e) => {
if (e.response.status === 401) {
setAnonymousUserId(null)
anonymousReq(null)
}
})
return
}
Expand Down

0 comments on commit e209fdb

Please sign in to comment.