chore: call tmp file cleanup on app startup
Integrates the bridge's cleanup_tmp_files() method into the Tauri setup phase. This ensures any orphaned .json.tmp files from previous crashes are cleaned up before the app starts operating. The cleanup runs early in setup(), before tray and shortcuts, to ensure a clean state for the bridge to operate in. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -126,6 +126,19 @@ pub fn run() {
|
|||||||
.build(),
|
.build(),
|
||||||
)
|
)
|
||||||
.setup(|app| {
|
.setup(|app| {
|
||||||
|
// Clean up orphaned tmp files from previous crashes
|
||||||
|
{
|
||||||
|
use data::beads::RealBeadsCli;
|
||||||
|
use data::bridge::Bridge;
|
||||||
|
use data::lore::RealLoreCli;
|
||||||
|
|
||||||
|
let bridge: Bridge<RealLoreCli, RealBeadsCli> =
|
||||||
|
Bridge::new(RealLoreCli, RealBeadsCli);
|
||||||
|
if let Err(e) = bridge.cleanup_tmp_files() {
|
||||||
|
tracing::warn!("Failed to clean up tmp files: {}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Set up system tray
|
// Set up system tray
|
||||||
if let Err(e) = setup_tray(app) {
|
if let Err(e) = setup_tray(app) {
|
||||||
tracing::error!("Failed to setup system tray: {}", e);
|
tracing::error!("Failed to setup system tray: {}", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user