@@ -209,8 +209,13 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
210 // Permissions
210 // Permissions
211 case pubsub.Event[permission.PermissionNotification]:
211 case pubsub.Event[permission.PermissionNotification]:
212+ item, ok := a.pages[a.currentPage]
212 // forward to page
217 // forward to page
213− updated, cmd := a.pages[a.currentPage].Update(msg)
218+ updated, cmd := item.Update(msg)
214 a.pages[a.currentPage] = updated.(util.Model)
219 a.pages[a.currentPage] = updated.(util.Model)
215 return a, cmd
220 return a, cmd
216 case pubsub.Event[permission.PermissionRequest]:
221 case pubsub.Event[permission.PermissionRequest]:
@@ -258,8 +263,13 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
259 return a, tea.Batch(cmds...)
264 return a, tea.Batch(cmds...)
260 case splash.OnboardingCompleteMsg:
265 case splash.OnboardingCompleteMsg:
266+ item, ok := a.pages[a.currentPage]
261 a.isConfigured = config.HasInitialDataConfig()
271 a.isConfigured = config.HasInitialDataConfig()
262− updated, pageCmd := a.pages[a.currentPage].Update(msg)
272+ updated, pageCmd := item.Update(msg)
263 a.pages[a.currentPage] = updated.(util.Model)
273 a.pages[a.currentPage] = updated.(util.Model)
264 cmds = append(cmds, pageCmd)
274 cmds = append(cmds, pageCmd)
265 return a, tea.Batch(cmds...)
275 return a, tea.Batch(cmds...)
@@ -273,7 +283,12 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
273 a.dialog = u.(dialogs.DialogCmp)
283 a.dialog = u.(dialogs.DialogCmp)
274 cmds = append(cmds, dialogCmd)
284 cmds = append(cmds, dialogCmd)
276− updated, pageCmd := a.pages[a.currentPage].Update(msg)
286+ item, ok := a.pages[a.currentPage]
291+ updated, pageCmd := item.Update(msg)
277 a.pages[a.currentPage] = updated.(util.Model)
292 a.pages[a.currentPage] = updated.(util.Model)
278 cmds = append(cmds, pageCmd)
293 cmds = append(cmds, pageCmd)
@@ -284,7 +299,12 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
284 a.dialog = u.(dialogs.DialogCmp)
299 a.dialog = u.(dialogs.DialogCmp)
285 cmds = append(cmds, dialogCmd)
300 cmds = append(cmds, dialogCmd)
287− updated, pageCmd := a.pages[a.currentPage].Update(msg)
302+ item, ok := a.pages[a.currentPage]
307+ updated, pageCmd := item.Update(msg)
288 a.pages[a.currentPage] = updated.(util.Model)
308 a.pages[a.currentPage] = updated.(util.Model)
289 cmds = append(cmds, pageCmd)
309 cmds = append(cmds, pageCmd)
@@ -292,8 +312,14 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
293 s, _ := a.status.Update(msg)
313 s, _ := a.status.Update(msg)
294 a.status = s.(status.StatusCmp)
314 a.status = s.(status.StatusCmp)
295− updated, cmd := a.pages[a.currentPage].Update(msg)
316+ item, ok := a.pages[a.currentPage]
320+ updated, cmd := item.Update(msg)
296 a.pages[a.currentPage] = updated.(util.Model)
321 a.pages[a.currentPage] = updated.(util.Model)
297 if a.dialog.HasDialogs() {
323 if a.dialog.HasDialogs() {
298 u, dialogCmd := a.dialog.Update(msg)
324 u, dialogCmd := a.dialog.Update(msg)
299 a.dialog = u.(dialogs.DialogCmp)
325 a.dialog = u.(dialogs.DialogCmp)
@@ -411,7 +437,12 @@ func (a *appModel) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
411 a.dialog = u.(dialogs.DialogCmp)
437 a.dialog = u.(dialogs.DialogCmp)
412 return dialogCmd
438 return dialogCmd
414− updated, cmd := a.pages[a.currentPage].Update(msg)
440+ item, ok := a.pages[a.currentPage]
445+ updated, cmd := item.Update(msg)
415 a.pages[a.currentPage] = updated.(util.Model)
446 a.pages[a.currentPage] = updated.(util.Model)
416 return cmd
447 return cmd