( a *App, loadingMessage string, node *api.Node, load func(*api.Node) (T, error), onLoaded func(T), onErrorMessage string, )
| 24 | } |
| 25 | |
| 26 | func loadGuestCreateData[T any]( |
| 27 | a *App, |
| 28 | loadingMessage string, |
| 29 | node *api.Node, |
| 30 | load func(*api.Node) (T, error), |
| 31 | onLoaded func(T), |
| 32 | onErrorMessage string, |
| 33 | ) { |
| 34 | a.header.ShowLoading(loadingMessage) |
| 35 | go func() { |
| 36 | data, err := load(node) |
| 37 | a.QueueUpdateDraw(func() { |
| 38 | a.header.ShowActiveProfile(a.header.GetCurrentProfile()) |
| 39 | if err != nil { |
| 40 | a.showMessageSafe(fmt.Sprintf("%s: %v", onErrorMessage, err)) |
| 41 | return |
| 42 | } |
| 43 | onLoaded(data) |
| 44 | }) |
| 45 | }() |
| 46 | } |
| 47 | |
| 48 | func (a *App) enqueueGuestCreateTask( |
| 49 | node *api.Node, |
no test coverage detected