mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 21:09:05 +00:00
Fixed previous problem, disabled button resets properly now.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react'
|
||||
import React, { useState, useEffect } from 'react'
|
||||
import { useMutation, gql } from '@apollo/client'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@@ -46,6 +46,10 @@ export const SidebarPhotoCover = ({ cover_id }: SidebarPhotoCoverProps) => {
|
||||
|
||||
const [buttonDisabled, setButtonDisabled] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setButtonDisabled(false)
|
||||
}, [cover_id])
|
||||
|
||||
return (
|
||||
<SidebarSection>
|
||||
<SidebarSectionTitle>
|
||||
@@ -99,6 +103,10 @@ export const SidebarAlbumCover = ({ id }: SidebarAlbumCoverProps) => {
|
||||
|
||||
const [buttonDisabled, setButtonDisabled] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
setButtonDisabled(false)
|
||||
}, [id])
|
||||
|
||||
return (
|
||||
<SidebarSection>
|
||||
<SidebarSectionTitle>
|
||||
|
||||
Reference in New Issue
Block a user