Make relm4 app async and update last_opened in db

This commit is contained in:
2024-02-07 20:05:20 +01:00
parent 603864e7f6
commit bea97b55f3
6 changed files with 88 additions and 30 deletions

View File

@@ -59,17 +59,22 @@ async fn main() {
let mut sheets = validation_result.validated_sheets;
sheets.append(&mut validation_result.updated_sheets);
let sheets_and_orphans = SheetsAndOrphans { sheets, orphans };
let app_init_data = AppInitData {
sheets,
orphans,
database,
};
let app = RelmApp::new("de.frajul.sheet-organizer");
// Pass empty command line args to allow my own parsing
app.with_args(Vec::new())
.run::<AppModel>(sheets_and_orphans);
.run_async::<AppModel>(app_init_data);
}
pub struct SheetsAndOrphans {
pub struct AppInitData {
sheets: Vec<Sheet>,
orphans: Vec<OrphanFile>,
database: Database,
}
pub struct FileValidationResult {