fix(dashboard): initial title value in rename modal set to currently selected dashboard (#5821)

Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
Co-authored-by: SagarRajput-7 <162284829+SagarRajput-7@users.noreply.github.com>
This commit is contained in:
Abhishek Mehandiratta 2024-10-09 13:32:17 +05:30 committed by GitHub
parent b03fadc2ec
commit 78a924d378
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -182,6 +182,15 @@ function DashboardDescription(props: DashboardDescriptionProps): JSX.Element {
const { t } = useTranslation(['dashboard', 'common']);
// used to set the initial value for the updatedTitle
// the context value is sometimes not available during the initial render
// due to which the updatedTitle is set to some previous value
useEffect(() => {
if (selectedDashboard) {
setUpdatedTitle(selectedDashboard.data.title);
}
}, [selectedDashboard]);
useEffect(() => {
if (state.error) {
notifications.error({