mirror of
https://github.com/Qortal/q-tube.git
synced 2025-02-11 17:55:51 +00:00
Merge branch 'main' of https://github.com/QortalSeth/q-tube
This commit is contained in:
commit
55535d7c86
@ -37,7 +37,7 @@ export const useFetchVideos = () => {
|
||||
|
||||
const checkAndUpdateVideo = React.useCallback(
|
||||
(video: Video) => {
|
||||
const existingVideo = hashMapVideos[video.id];
|
||||
const existingVideo = hashMapVideos[video.id + "-" + video.user];
|
||||
if (!existingVideo) {
|
||||
return true;
|
||||
} else if (
|
||||
|
@ -539,7 +539,8 @@ export const VideoList = ({ mode }: VideoListProps) => {
|
||||
|
||||
<VideoCardContainer>
|
||||
{videos.map((video: any, index: number) => {
|
||||
const existingVideo = hashMapVideos[video?.id];
|
||||
const fullId = video ? `${video.id}-${video.user}` : undefined;
|
||||
const existingVideo = hashMapVideos[fullId];
|
||||
let hasHash = false;
|
||||
let videoObj = video;
|
||||
if (existingVideo) {
|
||||
|
@ -133,7 +133,7 @@ export const VideoListComponentLevel = ({ mode }: VideoListProps) => {
|
||||
>
|
||||
<VideoCardContainer>
|
||||
{videos.map((video: any, index: number) => {
|
||||
const existingVideo = hashMapVideos[video.id];
|
||||
const existingVideo = hashMapVideos[video.id + '-' + video.user];
|
||||
let hasHash = false;
|
||||
let videoObj = video;
|
||||
if (existingVideo) {
|
||||
|
@ -261,7 +261,8 @@ export const PlaylistContent = () => {
|
||||
setPlaylistData(combinedData);
|
||||
if (combinedData?.videos?.length > 0) {
|
||||
const vid = combinedData?.videos[0];
|
||||
const existingVideo = hashMapVideos[vid?.identifier];
|
||||
const fullId = vid ? `${vid.identifier}-${vid.name}` : undefined;
|
||||
const existingVideo = hashMapVideos[fullId];
|
||||
|
||||
if (existingVideo) {
|
||||
setVideoData(existingVideo);
|
||||
|
@ -280,7 +280,7 @@ export const VideoContent = () => {
|
||||
|
||||
React.useEffect(() => {
|
||||
if (name && id) {
|
||||
const existingVideo = hashMapVideos[id];
|
||||
const existingVideo = hashMapVideos[id + '-' + name];
|
||||
|
||||
if (existingVideo) {
|
||||
setVideoData(existingVideo);
|
||||
|
@ -113,16 +113,16 @@ export const videoSlice = createSlice({
|
||||
},
|
||||
addToHashMap: (state, action) => {
|
||||
const video = action.payload
|
||||
state.hashMapVideos[video.id] = video
|
||||
state.hashMapVideos[video.id + '-' + video.user] = video
|
||||
},
|
||||
addtoHashMapSuperlikes: (state, action) => {
|
||||
const superlike = action.payload
|
||||
state.hashMapSuperlikes[superlike.identifier] = superlike
|
||||
},
|
||||
updateInHashMap: (state, action) => {
|
||||
const { id } = action.payload
|
||||
const { id, user } = action.payload
|
||||
const video = action.payload
|
||||
state.hashMapVideos[id] = { ...video }
|
||||
state.hashMapVideos[id + '-' + user] = { ...video }
|
||||
},
|
||||
removeFromHashMap: (state, action) => {
|
||||
const idToDelete = action.payload
|
||||
@ -131,7 +131,7 @@ export const videoSlice = createSlice({
|
||||
addArrayToHashMap: (state, action) => {
|
||||
const videos = action.payload
|
||||
videos.forEach((video: Video) => {
|
||||
state.hashMapVideos[video.id] = video
|
||||
state.hashMapVideos[video.id + '-' + video.user] = video
|
||||
})
|
||||
},
|
||||
upsertVideos: (state, action) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user