1
Fork 0

Fixed previous problem, disabled button resets properly now.

This commit is contained in:
Peter - Ubuntu dual boot 2021-09-18 21:58:25 +01:00
parent cb397096d5
commit 79d66ae16e
1 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import React, { useState } from 'react' import React, { useState, useEffect } from 'react'
import { useMutation, gql } from '@apollo/client' import { useMutation, gql } from '@apollo/client'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
@ -46,6 +46,10 @@ export const SidebarPhotoCover = ({ cover_id }: SidebarPhotoCoverProps) => {
const [buttonDisabled, setButtonDisabled] = useState(false) const [buttonDisabled, setButtonDisabled] = useState(false)
useEffect(() => {
setButtonDisabled(false)
}, [cover_id])
return ( return (
<SidebarSection> <SidebarSection>
<SidebarSectionTitle> <SidebarSectionTitle>
@ -99,6 +103,10 @@ export const SidebarAlbumCover = ({ id }: SidebarAlbumCoverProps) => {
const [buttonDisabled, setButtonDisabled] = useState(false) const [buttonDisabled, setButtonDisabled] = useState(false)
useEffect(() => {
setButtonDisabled(false)
}, [id])
return ( return (
<SidebarSection> <SidebarSection>
<SidebarSectionTitle> <SidebarSectionTitle>