@@ -87,7 +87,7 @@ class Views extends TableView {
8787 }
8888 }
8989
90- async loadViews ( app ) {
90+ async loadViews ( app , skipDataReload = false ) {
9191 // Initialize ViewPreferencesManager if not already done or if app changed
9292 if ( ! this . viewPreferencesManager || this . viewPreferencesManager . app !== app ) {
9393 this . viewPreferencesManager = new ViewPreferencesManager ( app ) ;
@@ -132,7 +132,7 @@ class Views extends TableView {
132132 }
133133 }
134134 } ) ;
135- if ( this . _isMounted ) {
135+ if ( this . _isMounted && ! skipDataReload ) {
136136 this . loadData ( this . props . params . name ) ;
137137 }
138138 } ) ;
@@ -141,7 +141,7 @@ class Views extends TableView {
141141 // Fallback to local storage
142142 const views = ViewPreferences . getViews ( app . applicationId ) ;
143143 this . setState ( { views, counts : { } } , ( ) => {
144- if ( this . _isMounted ) {
144+ if ( this . _isMounted && ! skipDataReload ) {
145145 this . loadData ( this . props . params . name ) ;
146146 }
147147 } ) ;
@@ -757,6 +757,7 @@ class Views extends TableView {
757757 view = { this . state . editView }
758758 onCancel = { ( ) => this . setState ( { editView : null , editIndex : null } ) }
759759 onConfirm = { view => {
760+ const isEditingCurrentView = view . name === this . props . params . name ;
760761 this . setState (
761762 state => {
762763 const newViews = [ ...state . views ] ;
@@ -772,7 +773,10 @@ class Views extends TableView {
772773 this . showNote ( 'Failed to save view changes' , true ) ;
773774 }
774775 }
775- this . loadViews ( this . context ) ;
776+ // Only reload data if we're editing the currently displayed view
777+ // Otherwise just reload the view list without reloading data
778+ const skipDataReload = ! isEditingCurrentView ;
779+ this . loadViews ( this . context , skipDataReload ) ;
776780 }
777781 ) ;
778782 } }
0 commit comments