Skip to content

Commit

Permalink
fix(dashboard): initial title value in rename modal set to currently …
Browse files Browse the repository at this point in the history
…selected dashboard (#5821)

Co-authored-by: Srikanth Chekuri <[email protected]>
Co-authored-by: SagarRajput-7 <[email protected]>
  • Loading branch information
3 people authored Oct 9, 2024
1 parent b03fadc commit 78a924d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 78a924d

Please sign in to comment.