git-watchtower 1.9.18 → 1.9.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -964,6 +964,7 @@ async function refreshAllSparklines() {
964
964
  return; // Don't refresh too often
965
965
  }
966
966
 
967
+ const sparklineCache = new Map(store.get('sparklineCache'));
967
968
  const currentBranches = store.get('branches');
968
969
  for (const branch of currentBranches.slice(0, 20)) { // Limit to top 20
969
970
  if (branch.isDeleted) continue;
@@ -997,11 +998,12 @@ async function refreshAllSparklines() {
997
998
  }
998
999
 
999
1000
  const counts = Array.from(dayCounts.values());
1000
- store.get('sparklineCache').set(branch.name, generateSparkline(counts));
1001
+ sparklineCache.set(branch.name, generateSparkline(counts));
1001
1002
  } catch (e) {
1002
1003
  // Skip this branch - don't let one failure abort all sparkline updates
1003
1004
  }
1004
1005
  }
1006
+ store.setState({ sparklineCache });
1005
1007
  lastSparklineUpdate = now;
1006
1008
  }
1007
1009
 
@@ -1411,9 +1413,11 @@ async function switchToBranch(branchName, recordHistory = true) {
1411
1413
  store.setState({ currentBranch: safeBranchName, isDetachedHead: false });
1412
1414
 
1413
1415
  // Clear NEW flag when branch becomes current
1414
- const branchInfo = store.get('branches').find(b => b.name === safeBranchName);
1416
+ const branches = store.get('branches');
1417
+ const branchInfo = branches.find(b => b.name === safeBranchName);
1415
1418
  if (branchInfo && branchInfo.isNew) {
1416
1419
  branchInfo.isNew = false;
1420
+ store.setState({ branches: [...branches] });
1417
1421
  }
1418
1422
 
1419
1423
  // Record in history (for undo)
@@ -1868,10 +1872,10 @@ async function pollGitChanges() {
1868
1872
  await execGit(['pull', REMOTE_NAME, autoPullBranchName], { cwd: PROJECT_ROOT, timeout: 60000 });
1869
1873
  addLog(`Pulled successfully from ${autoPullBranchName}`, 'success');
1870
1874
  currentInfo.hasUpdates = false;
1871
- store.setState({ hasMergeConflict: false });
1872
1875
  // Update the stored commit to the new one
1873
1876
  const newCommit = await execGit(['rev-parse', '--short', 'HEAD'], { cwd: PROJECT_ROOT });
1874
1877
  currentInfo.commit = newCommit.stdout.trim();
1878
+ store.setState({ hasMergeConflict: false, branches: [...store.get('branches')] });
1875
1879
  previousBranchStates.set(autoPullBranchName, newCommit.stdout.trim());
1876
1880
  // Reload browsers
1877
1881
  notifyClients();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-watchtower",
3
- "version": "1.9.18",
3
+ "version": "1.9.20",
4
4
  "description": "Terminal-based Git branch monitor with activity sparklines and optional dev server with live reload",
5
5
  "main": "bin/git-watchtower.js",
6
6
  "bin": {