@@ -1066,7 +1066,8 @@ function NoteForge() {
10661066 const [ masterHint , setMasterHint ] = useState ( null ) ;
10671067 const [ pwDialog , setPwDialog ] = useState ( null ) ; // null | {type,nbId,...}
10681068 const [ pwError , setPwError ] = useState ( "" ) ;
1069- const [ unlockedNbs , setUnlockedNbs ] = useState ( new Set ( ) ) ; // notebook IDs unlocked this session
1069+ const [ unlockedNbs , setUnlockedNbs ] = useState ( new Set ( ) ) ;
1070+ const [ autoUpdate , setAutoUpdate ] = useState ( true ) ; // loaded from config // notebook IDs unlocked this session
10701071
10711072 const edRef = useRef ( null ) ;
10721073 const saveTimer = useRef ( null ) ;
@@ -1187,6 +1188,11 @@ function NoteForge() {
11871188 /* ── Load (encryption-aware) ─────────────────────────────── */
11881189 useEffect ( ( ) => {
11891190 ( async ( ) => {
1191+ // Load config
1192+ if ( window . electronAPI ?. getConfig ) {
1193+ const cfg = await window . electronAPI . getConfig ( ) ;
1194+ if ( cfg . autoUpdate !== undefined ) setAutoUpdate ( cfg . autoUpdate ) ;
1195+ }
11901196 if ( hasElectronCrypto ( ) ) {
11911197 const status = await window . electronAPI . checkEncryption ( ) ;
11921198 setEncEnabled ( status . encrypted ) ;
@@ -2005,9 +2011,9 @@ function NoteForge() {
20052011 s : 32
20062012 } ) ) , /*#__PURE__*/ React . createElement ( "div" , {
20072013 className : "nf-overlay-title"
2008- } , "Encryption Settings" ) , /*#__PURE__*/ React . createElement ( "div" , {
2014+ } , "Settings" ) , /*#__PURE__*/ React . createElement ( "div" , {
20092015 className : "nf-overlay-sub"
2010- } , "AES-256-GCM encryption for all your notes ." ) , /*#__PURE__*/ React . createElement ( "div" , {
2016+ } , "Encryption, auto-lock, and updates ." ) , /*#__PURE__*/ React . createElement ( "div" , {
20112017 style : {
20122018 textAlign : "left" ,
20132019 fontSize : 13 ,
@@ -2016,11 +2022,11 @@ function NoteForge() {
20162022 background : "var(--surface-alt)" ,
20172023 borderRadius : 8
20182024 }
2019- } , "Status : " , /*#__PURE__*/ React . createElement ( "strong" , {
2025+ } , "Encryption : " , /*#__PURE__*/ React . createElement ( "strong" , {
20202026 style : {
20212027 color : encEnabled ? "var(--success)" : "var(--text-muted)"
20222028 }
2023- } , encEnabled ? "Encrypted " : "Not encrypted " ) ) , encEnabled && /*#__PURE__*/ React . createElement ( "div" , {
2029+ } , encEnabled ? "Enabled (AES-256-GCM) " : "Not enabled " ) ) , encEnabled && /*#__PURE__*/ React . createElement ( "div" , {
20242030 style : {
20252031 textAlign : "left" ,
20262032 fontSize : 13 ,
@@ -2056,7 +2062,65 @@ function NoteForge() {
20562062 fontSize : 11 ,
20572063 color : "var(--text-muted)"
20582064 }
2059- } , "of inactivity" ) ) , ! encEnabled && /*#__PURE__*/ React . createElement ( "button" , {
2065+ } , "of inactivity" ) ) , /*#__PURE__*/ React . createElement ( "div" , {
2066+ style : {
2067+ textAlign : "left" ,
2068+ fontSize : 13 ,
2069+ marginBottom : 16 ,
2070+ padding : "10px 12px" ,
2071+ background : "var(--surface-alt)" ,
2072+ borderRadius : 8 ,
2073+ display : "flex" ,
2074+ alignItems : "center" ,
2075+ justifyContent : "space-between"
2076+ }
2077+ } , /*#__PURE__*/ React . createElement ( "div" , null , /*#__PURE__*/ React . createElement ( "div" , null , "Auto-update" ) , /*#__PURE__*/ React . createElement ( "div" , {
2078+ style : {
2079+ fontSize : 11 ,
2080+ color : "var(--text-muted)"
2081+ }
2082+ } , "Check GitHub for new versions on launch" ) ) , /*#__PURE__*/ React . createElement ( "label" , {
2083+ style : {
2084+ position : "relative" ,
2085+ width : 40 ,
2086+ height : 22 ,
2087+ flexShrink : 0 ,
2088+ cursor : "pointer"
2089+ }
2090+ } , /*#__PURE__*/ React . createElement ( "input" , {
2091+ type : "checkbox" ,
2092+ checked : autoUpdate ,
2093+ onChange : async e => {
2094+ const val = e . target . checked ;
2095+ setAutoUpdate ( val ) ;
2096+ if ( window . electronAPI ?. setConfig ) await window . electronAPI . setConfig ( "autoUpdate" , val ) ;
2097+ } ,
2098+ style : {
2099+ opacity : 0 ,
2100+ width : 0 ,
2101+ height : 0
2102+ }
2103+ } ) , /*#__PURE__*/ React . createElement ( "span" , {
2104+ style : {
2105+ position : "absolute" ,
2106+ inset : 0 ,
2107+ borderRadius : 11 ,
2108+ background : autoUpdate ? "var(--accent)" : "var(--border)" ,
2109+ transition : "background .2s"
2110+ }
2111+ } , /*#__PURE__*/ React . createElement ( "span" , {
2112+ style : {
2113+ position : "absolute" ,
2114+ top : 2 ,
2115+ left : autoUpdate ? 20 : 2 ,
2116+ width : 18 ,
2117+ height : 18 ,
2118+ borderRadius : "50%" ,
2119+ background : "#fff" ,
2120+ transition : "left .2s" ,
2121+ boxShadow : "0 1px 3px rgba(0,0,0,.3)"
2122+ }
2123+ } ) ) ) ) , ! encEnabled && /*#__PURE__*/ React . createElement ( "button" , {
20602124 className : "nf-overlay-btn primary" ,
20612125 onClick : ( ) => setPwDialog ( {
20622126 type : "enable-enc"
0 commit comments