From 79d66ae16ed7eac29a46ad81759b24b52a3501b1 Mon Sep 17 00:00:00 2001 From: Peter - Ubuntu dual boot Date: Sat, 18 Sep 2021 21:58:25 +0100 Subject: [PATCH] Fixed previous problem, disabled button resets properly now. --- ui/src/components/sidebar/AlbumCovers.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/src/components/sidebar/AlbumCovers.tsx b/ui/src/components/sidebar/AlbumCovers.tsx index ec63622b..034b2ac4 100644 --- a/ui/src/components/sidebar/AlbumCovers.tsx +++ b/ui/src/components/sidebar/AlbumCovers.tsx @@ -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 ( @@ -99,6 +103,10 @@ export const SidebarAlbumCover = ({ id }: SidebarAlbumCoverProps) => { const [buttonDisabled, setButtonDisabled] = useState(false) + useEffect(() => { + setButtonDisabled(false) + }, [id]) + return (