Skip to content

Commit 0cf7c13

Browse files
committed
Fix Lock App menu and post-unlock blank editor (2.7.2)
1 parent 9706d8f commit 0cf7c13

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versio
55

66
## [Unreleased]
77

8+
## [2.7.2] — 2026-04-28
9+
10+
### Fixed
11+
- **File → Lock App menu item** now actually locks the app. The menu-action listener was registered with an empty dependency array, so its handler captured the initial `encEnabled = false` closure and the lock branch never fired. The Ctrl+L shortcut was unaffected because its listener already tracked `encEnabled` and `lockApp` in its deps.
12+
- **Editor content blank after unlock** when the unlock landed on the same page the user was viewing before locking. The editor's `prevPgRef` guard wasn't reset on lock (the sync effect early-returns when `edRef.current` is null during the password-dialog phase), so after unlock `aPg === prevPgRef.current` and the `innerHTML` write was skipped. `lockApp` now clears `prevPgRef.current` so the next paint always fires.
13+
814
## [2.6.1] — 2026-04-16
915

1016
Security hardening round plus a cross-notebook bug fix and Windows taskbar polish.

app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,7 @@ function NoteForge() {
14101410
setASec(null);
14111411
setAPg(null);
14121412
setUnlockedNbs(new Set());
1413+
prevPgRef.current = null; // Force editor to repaint content after unlock even if we land on the same page id
14131414
if (encEnabled) setAppPhase("needsPassword");
14141415
}, [encEnabled]);
14151416

@@ -1819,7 +1820,7 @@ function NoteForge() {
18191820
}
18201821
});
18211822
return cleanup;
1822-
}, []);
1823+
}, [encEnabled, lockApp]);
18231824

18241825
// Track cursor format for heading/font-size select reflection
18251826
useEffect(() => {

app.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ function NoteForge(){
552552
nbKeys.current.clear();
553553
dataRef.current=null;setData(null);setANb(null);setASec(null);setAPg(null);
554554
setUnlockedNbs(new Set());
555+
prevPgRef.current=null; // Force editor to repaint content after unlock even if we land on the same page id
555556
if(encEnabled)setAppPhase("needsPassword");
556557
},[encEnabled]);
557558

@@ -831,7 +832,7 @@ function NoteForge(){
831832
}
832833
});
833834
return cleanup;
834-
},[]);
835+
},[encEnabled,lockApp]);
835836

836837
// Track cursor format for heading/font-size select reflection
837838
useEffect(()=>{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "noteforge",
3-
"version": "2.7.1",
3+
"version": "2.7.2",
44
"description": "Encrypted offline note-taking — a OneNote alternative that keeps your data local and protected.",
55
"main": "main.js",
66
"author": {

0 commit comments

Comments
 (0)