One-click backups for AT Protocol

feat: check for updates when opened

Turtlepaw 8c5585c4 3dd28ba5

Changed files
+14 -2
src
+14 -2
src/App.tsx
··· 145 145 // }, [isAuthenticated, agent]); 146 146 147 147 useEffect(() => { 148 - (async () => { 148 + const checkUpdates = async () => { 149 149 const update = await check(); 150 150 if (update) { 151 151 console.log( 152 152 `found update ${update.version} from ${update.date} with notes ${update.body}` 153 153 ); 154 154 setUpdate(update); 155 + } else { 156 + console.log("no updates"); 155 157 } 156 - })(); 158 + }; 159 + 160 + checkUpdates(); 161 + const unlistenVisible = appWindow.listen("tauri://focus", () => { 162 + checkUpdates(); 163 + }); 164 + 165 + return () => { 166 + // Cleanup listeners 167 + unlistenVisible.then((unlisten) => unlisten()); 168 + }; 157 169 }, []); 158 170 159 171 return (