loadAndDisplayAsync handles the complete async loading workflow
(loader func(*Buffer, chan<- bool, chan<- error), source string)
| 118 | |
| 119 | // loadAndDisplayAsync handles the complete async loading workflow |
| 120 | func loadAndDisplayAsync(loader func(*Buffer, chan<- bool, chan<- error), source string) error { |
| 121 | updateChan, doneChan, err := loadDataAsync(loader, b) |
| 122 | if err != nil { |
| 123 | return err |
| 124 | } |
| 125 | |
| 126 | setupFreezeMode(b) |
| 127 | if err := validateDataNotEmpty(b, source); err != nil { |
| 128 | return err |
| 129 | } |
| 130 | |
| 131 | if err := drawUI(b); err != nil { |
| 132 | return err |
| 133 | } |
| 134 | |
| 135 | startAsyncUpdateHandler(updateChan, doneChan) |
| 136 | return runApp() |
| 137 | } |
| 138 | |
| 139 | // loadAndDisplaySync handles the complete sync loading workflow |
| 140 | func loadAndDisplaySync(loader func(*Buffer) error, source string) error { |
no test coverage detected