mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-05 07:44:38 +00:00
chore: disable unrelated eslint rules
This commit is contained in:
parent
ff11a90a5e
commit
733e138233
20 changed files with 43 additions and 16 deletions
23
app/App.tsx
23
app/App.tsx
|
@ -18,21 +18,24 @@ export const App = (props) => {
|
|||
const [currentVersion, setCurrentVersion] = useState("");
|
||||
const [previousVersions, setPreviousVersions] = useState([]);
|
||||
|
||||
async function _checkVersion() {
|
||||
const res = await fetch("/api/version");
|
||||
const data = await res.json();
|
||||
|
||||
if (data.version !== preferencesStore.params.version) {
|
||||
setShowChangelog(true);
|
||||
setCurrentVersion(data.version);
|
||||
setPreviousVersions(data.previous);
|
||||
}
|
||||
}
|
||||
useEffect(() => {
|
||||
async function _checkVersion() {
|
||||
const res = await fetch("/api/version");
|
||||
const data = await res.json();
|
||||
|
||||
if (data.version !== preferencesStore.params.version) {
|
||||
setShowChangelog(true);
|
||||
setCurrentVersion(data.version);
|
||||
setPreviousVersions(data.previous);
|
||||
}
|
||||
}
|
||||
|
||||
if (preferencesStore._hasHydrated) {
|
||||
_checkVersion();
|
||||
userStore.checkAuth();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [preferencesStore._hasHydrated]);
|
||||
|
||||
if (!preferencesStore._hasHydrated && !userStore._hasHydrated) {
|
||||
|
|
|
@ -40,6 +40,7 @@ export const ChangelogModal = (props: {
|
|||
});
|
||||
});
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [props.version]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -42,6 +42,7 @@ export const CollectionInfoBasics = (props: {
|
|||
width={725}
|
||||
height={400}
|
||||
className="w-full rounded-lg"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
|
|
|
@ -99,6 +99,7 @@ export const CommentsComment = (props: {
|
|||
setShouldRender(false);
|
||||
setCommentSend(false);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [commentSend]);
|
||||
|
||||
async function _sendVote(action: number) {
|
||||
|
|
|
@ -155,6 +155,7 @@ const CommentsAllModal = (props: {
|
|||
if (scrollPosition >= 95 && scrollPosition <= 96) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -13,12 +13,11 @@ export const RelatedSection = (props: any) => {
|
|||
<section>
|
||||
<div className="flex flex-col justify-between gap-4 p-4 xl:flex-row">
|
||||
<div className="flex items-center justify-center p-4">
|
||||
{props.images.map((item) => {
|
||||
{props.images.map((item, index) => {
|
||||
return (
|
||||
<div className="w-[100px] lg:w-[300px] aspect-[9/12] even:scale-110 shadow-md even:shadow-lg even:z-30 origin-center first:[transform:translateX(25%)] last:[transform:translateX(-25%)]">
|
||||
<div key={`related-img-${index}`} className="w-[100px] lg:w-[300px] aspect-[9/12] even:scale-110 shadow-md even:shadow-lg even:z-30 origin-center first:[transform:translateX(25%)] last:[transform:translateX(-25%)]">
|
||||
<Image
|
||||
fill={true}
|
||||
key={item}
|
||||
src={item}
|
||||
alt=""
|
||||
sizes="
|
||||
|
|
|
@ -184,8 +184,10 @@ const AddReleaseToCollectionModal = (props: {
|
|||
if (scrollPosition >= 95 && scrollPosition <= 96) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
|
||||
function _addToCollection(collection_id: number) {
|
||||
if (props.token) {
|
||||
fetch(
|
||||
|
|
|
@ -36,6 +36,7 @@ export function BookmarksPage() {
|
|||
if (authState === "finished" && !token) {
|
||||
router.push("/login?redirect=/bookmarks");
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [authState, token]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -70,12 +70,14 @@ export function BookmarksCategoryPage(props: any) {
|
|||
if (scrollPosition >= 98 && scrollPosition <= 99) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
useEffect(() => {
|
||||
if (authState === "finished" && !token) {
|
||||
router.push(`/login?redirect=/bookmarks/${props.slug}`);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [authState, token]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -35,6 +35,7 @@ export function CollectionsPage() {
|
|||
if (userStore.state === "finished" && !userStore.token) {
|
||||
router.push("/login?redirect=/collections");
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [userStore.state, userStore.token]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -76,6 +76,7 @@ export function CollectionsFullPage(props: {
|
|||
if (scrollPosition >= 98 && scrollPosition <= 99) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -86,6 +87,7 @@ export function CollectionsFullPage(props: {
|
|||
) {
|
||||
router.push(`/login?redirect=/collections/favorites`);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [userStore.state, userStore.token]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -39,7 +39,6 @@ export const CreateCollectionPage = () => {
|
|||
|
||||
const [edit, setEdit] = useState(false);
|
||||
|
||||
// const [imageData, setImageData] = useState<File | Blob>(null);
|
||||
const [imageUrl, setImageUrl] = useState<string>(null);
|
||||
const [tempImageUrl, setTempImageUrl] = useState<string>(null);
|
||||
const [isPrivate, setIsPrivate] = useState(false);
|
||||
|
@ -118,6 +117,7 @@ export const CreateCollectionPage = () => {
|
|||
if (userStore.user) {
|
||||
_checkMode();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [userStore.user]);
|
||||
|
||||
const handleFileRead = (e, fileReader) => {
|
||||
|
@ -265,9 +265,11 @@ export const CreateCollectionPage = () => {
|
|||
</p>
|
||||
</>
|
||||
) : (
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
<img
|
||||
src={imageUrl}
|
||||
className="object-cover w-[inherit] h-[inherit]"
|
||||
alt=""
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
@ -457,6 +459,7 @@ export const ReleasesEditModal = (props: {
|
|||
if (scrollPosition >= 95 && scrollPosition <= 96) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
function _addRelease(release: any) {
|
||||
|
|
|
@ -67,12 +67,14 @@ export function FavoritesPage() {
|
|||
if (scrollPosition >= 98 && scrollPosition <= 99) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
useEffect(() => {
|
||||
if (authState === "finished" && !token) {
|
||||
router.push("/login?redirect=/favorites");
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [authState, token]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -59,12 +59,14 @@ export function HistoryPage() {
|
|||
if (scrollPosition >= 98 && scrollPosition <= 99) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
useEffect(() => {
|
||||
if (authState === "finished" && !token) {
|
||||
router.push("/login?redirect=/history");
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [authState, token]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -25,6 +25,7 @@ export function IndexCategoryPage(props) {
|
|||
}
|
||||
|
||||
_loadInitialReleases();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [token]);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -36,6 +37,7 @@ export function IndexCategoryPage(props) {
|
|||
if (content) {
|
||||
_loadNextReleasesPage();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [page]);
|
||||
|
||||
const scrollPosition = useScrollPosition();
|
||||
|
@ -43,10 +45,9 @@ export function IndexCategoryPage(props) {
|
|||
if (scrollPosition == 98) {
|
||||
setPage(page + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
// if (error) return <div>failed to load</div>;
|
||||
|
||||
return (
|
||||
<>
|
||||
{content && content.length > 0 ? (
|
||||
|
|
|
@ -49,6 +49,7 @@ export function LoginPage() {
|
|||
if (userStore.user) {
|
||||
router.push(`${redirect || "/"}`);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [userStore.user]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -24,6 +24,7 @@ export const ProfilePage = (props: any) => {
|
|||
setIsMyProfile(data.is_my_profile);
|
||||
}
|
||||
_getData();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [authUser]);
|
||||
|
||||
if (!user) {
|
||||
|
|
|
@ -54,6 +54,7 @@ export function RelatedPage(props: {id: number|string, title: string}) {
|
|||
if (scrollPosition >= 98 && scrollPosition <= 99) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -85,6 +85,7 @@ export function SearchPage() {
|
|||
if (scrollPosition >= 98 && scrollPosition <= 99) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
if (error) return <div>failed to load</div>;
|
||||
|
|
|
@ -86,6 +86,7 @@ export const ViewCollectionPage = (props: { id: number }) => {
|
|||
if (scrollPosition >= 98 && scrollPosition <= 99) {
|
||||
setSize(size + 1);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [scrollPosition]);
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Reference in a new issue