fix: restore refresh operations broken by nav_gen regression (C-1, S-2)
Change nav_gen default from 0 to None in _fetch_list_contents_bg and _finalize_list_loading. The guard is updated to only apply when a gen is explicitly provided (`nav_gen is not None`). Refresh call sites (lines 1515, 1529, 1538) pass no gen, so they receive None and bypass the guard — their results are always applied. Navigation calls still pass an explicit integer gen, so stale-navigation protection remains fully intact. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1892,7 +1892,7 @@ class SharePointApp(wx.Frame):
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
def _fetch_list_contents_bg(self, data, nav_gen=0):
|
||||
def _fetch_list_contents_bg(self, data, nav_gen=None):
|
||||
if not self.ensure_valid_token(): return
|
||||
self.pulse_gauge(True)
|
||||
items_data = []
|
||||
@@ -1973,9 +1973,9 @@ class SharePointApp(wx.Frame):
|
||||
self.list_ctrl.SetItem(idx, 2, size_str)
|
||||
self.list_ctrl.SetItem(idx, 3, item['modified'])
|
||||
|
||||
def _finalize_list_loading(self, items_data, nav_gen=0):
|
||||
def _finalize_list_loading(self, items_data, nav_gen=None):
|
||||
if not self: return
|
||||
if nav_gen != self._nav_gen:
|
||||
if nav_gen is not None and nav_gen != self._nav_gen:
|
||||
return # User navigated away; discard stale results
|
||||
self.current_items = items_data
|
||||
self.apply_sorting()
|
||||
|
||||
Reference in New Issue
Block a user