diff --git a/package-lock.json b/package-lock.json index feda034..19cf1a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "localforage": "^1.10.0", "mediainfo.js": "^0.3.5", "moment": "^2.30.1", - "qapp-core": "^1.0.50", + "qapp-core": "^1.0.51", "quill": "^2.0.2", "quill-image-resize-module-react": "^3.0.0", "react": "^19.0.0", @@ -5104,9 +5104,9 @@ } }, "node_modules/qapp-core": { - "version": "1.0.50", - "resolved": "https://registry.npmjs.org/qapp-core/-/qapp-core-1.0.50.tgz", - "integrity": "sha512-vk1NAUN7tVAU3BADyvJKY3w0GCp+ddtR1Zly0/qw2tuEEkjUso3y7r+hO+uknQDCE0F4IQ0Ee1PJDVaFGLVFFQ==", + "version": "1.0.51", + "resolved": "https://registry.npmjs.org/qapp-core/-/qapp-core-1.0.51.tgz", + "integrity": "sha512-a61AdMmZbs/AdcDhm6NNtAbxonTQuTcvUTT9fFBzQX/zynmkK3T5bmfdkVS291QIuISpBhpCGOMYaW6dYVcdXQ==", "license": "MIT", "dependencies": { "@tanstack/react-virtual": "^3.13.2", diff --git a/package.json b/package.json index 225ddb2..54a9756 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "localforage": "^1.10.0", "mediainfo.js": "^0.3.5", "moment": "^2.30.1", - "qapp-core": "^1.0.50", + "qapp-core": "^1.0.51", "quill": "^2.0.2", "quill-image-resize-module-react": "^3.0.0", "react": "^19.0.0", diff --git a/src/AppWrapper.tsx b/src/AppWrapper.tsx index 09f3484..6bad165 100644 --- a/src/AppWrapper.tsx +++ b/src/AppWrapper.tsx @@ -9,6 +9,9 @@ export const AppWrapper = () => { config={{ auth: { authenticateOnMount: true, + balanceSetting: { + interval: 120000, + }, }, publicSalt: 'usVbeM9YpjGCbLrTcc78YJS0ap1AxDkHAOMZrp3+wDY=', appName: 'Q-Tube', diff --git a/src/components/Publish/EditPlaylist/EditPlaylist.tsx b/src/components/Publish/EditPlaylist/EditPlaylist.tsx index 74b588f..65b6583 100644 --- a/src/components/Publish/EditPlaylist/EditPlaylist.tsx +++ b/src/components/Publish/EditPlaylist/EditPlaylist.tsx @@ -177,7 +177,7 @@ export const EditPlaylist = () => { 'Cannot publish without access to your name. Please authenticate.'; } - if (!isNew && editVideoProperties?.user !== username) { + if (!isNew && editVideoProperties?.name !== username) { errorMsg = "Cannot publish another user's resource"; } @@ -220,8 +220,7 @@ export const EditPlaylist = () => { }); const id = uid.rnd(); - let commentsId = editVideoProperties?.id; - + let commentsId = editVideoProperties?.identifier; if (isNew) { commentsId = `${QTUBE_PLAYLIST_BASE}_cm_${id}`; } @@ -249,7 +248,7 @@ export const EditPlaylist = () => { // Description is obtained from raw data - let identifier = editVideoProperties?.id; + let identifier = editVideoProperties?.identifier; const sanitizeTitle = title .replace(/[^a-zA-Z0-9\s-]/g, '') .replace(/\s+/g, '-') diff --git a/src/components/common/ContentButtons/FollowButton.tsx b/src/components/common/ContentButtons/FollowButton.tsx index e92e985..6e7ba15 100644 --- a/src/components/common/ContentButtons/FollowButton.tsx +++ b/src/components/common/ContentButtons/FollowButton.tsx @@ -4,6 +4,11 @@ import { MouseEvent, useEffect, useState } from 'react'; import { darken, styled } from '@mui/material/styles'; import { CustomTooltip, TooltipLine } from './CustomTooltip.tsx'; import { useTranslation } from 'react-i18next'; +import { + followListAtom, + hasFetchFollowListAtom, +} from '../../../state/global/names.ts'; +import { useAtom } from 'jotai'; interface FollowButtonProps extends ButtonProps { followerName: string; @@ -17,7 +22,9 @@ export type FollowData = { export const FollowButton = ({ followerName, ...props }: FollowButtonProps) => { const { t } = useTranslation(['core']); - const [followingList, setFollowingList] = useState([]); + const [followingList, setFollowingList] = useAtom(followListAtom); + const [hasFetchedFollow, setHasFetchFollow] = useAtom(hasFetchFollowListAtom); + const [followingSize, setFollowingSize] = useState(''); const [followingItemCount, setFollowingItemCount] = useState(''); const isFollowingName = () => { @@ -25,14 +32,20 @@ export const FollowButton = ({ followerName, ...props }: FollowButtonProps) => { }; useEffect(() => { + if (hasFetchedFollow !== null) return; qortalRequest({ action: 'GET_LIST_ITEMS', list_name: 'followedNames', - }).then((followList) => { - setFollowingList(followList); - }); + }) + .then((followList) => { + setFollowingList(followList); + setHasFetchFollow(true); + }) + .catch(() => { + setHasFetchFollow(false); + }); getFollowSize(); - }, []); + }, [hasFetchedFollow]); const followName = () => { if (followingList.includes(followerName) === false) { @@ -147,6 +160,7 @@ export const FollowButton = ({ followerName, ...props }: FollowButtonProps) => { <>