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 // }, [isAuthenticated, agent]); 146 147 useEffect(() => { 148 - (async () => { 149 const update = await check(); 150 if (update) { 151 console.log( 152 `found update ${update.version} from ${update.date} with notes ${update.body}` 153 ); 154 setUpdate(update); 155 } 156 - })(); 157 }, []); 158 159 return (
··· 145 // }, [isAuthenticated, agent]); 146 147 useEffect(() => { 148 + const checkUpdates = async () => { 149 const update = await check(); 150 if (update) { 151 console.log( 152 `found update ${update.version} from ${update.date} with notes ${update.body}` 153 ); 154 setUpdate(update); 155 + } else { 156 + console.log("no updates"); 157 } 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 + }; 169 }, []); 170 171 return (