Fixed previous problem, disabled button resets properly now.
This commit is contained in:
parent
cb397096d5
commit
79d66ae16e
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue