Make relm4 app async and update last_opened in db
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -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 {
|
||||
|
Reference in New Issue
Block a user