Simplify read_collection_file call in on_activate
This commit is contained in:
parent
e3984b0ffb
commit
5d9893d304
1 changed files with 4 additions and 6 deletions
10
src/main.rs
10
src/main.rs
|
@ -22,15 +22,13 @@ fn main () -> ExitCode {
|
|||
|
||||
fn on_activate ( app : & Application ) {
|
||||
let ui = UI :: new (app) ;
|
||||
|
||||
let collection_handle = spawn_blocking ( ||
|
||||
read_collection_file () . unwrap ()
|
||||
) ;
|
||||
|
||||
ui . show_window () ;
|
||||
|
||||
spawn_future_local ( async move {
|
||||
let collection = collection_handle . await . unwrap () ;
|
||||
let collection = spawn_blocking ( ||
|
||||
read_collection_file () . unwrap ()
|
||||
) . await . unwrap () ;
|
||||
|
||||
ui . render_collection (collection) ;
|
||||
} ) ;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue