Skip to content

Commit

Permalink
fix: GetMissing closes #45
Browse files Browse the repository at this point in the history
  • Loading branch information
blacktop committed Sep 14, 2023
1 parent fd3d766 commit 34dce31
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@ func (lp *LaunchPad) GetMissing(apps *Apps, appType int) error {
return fmt.Errorf("mapstructure unable to decode config folder: %w", err)
}
for fpIdx, fpage := range folder.Pages {
for fpiIdx, fitem := range fpage.Items {
tmp := []any{}
for _, fitem := range fpage.Items {
if !slices.Contains(lp.dbApps, fitem) {
utils.DoubleIndent(log.WithField("app", fitem).Warn)("found app in config that are is not on system")
apps.Pages[idx].Items[iidx].(map[string]any)["pages"].([]any)[fpIdx].(map[string]any)["items"] = append(
apps.Pages[idx].Items[iidx].(map[string]any)["pages"].([]any)[fpIdx].(map[string]any)["items"].([]any)[:fpiIdx],
apps.Pages[idx].Items[iidx].(map[string]any)["pages"].([]any)[fpIdx].(map[string]any)["items"].([]any)[fpiIdx+1:]...)
} else {
tmp = append(tmp, fitem)
}
}
apps.Pages[idx].Items[iidx].(map[string]any)["pages"].([]any)[fpIdx].(map[string]any)["items"] = tmp
}
}
}
Expand Down

0 comments on commit 34dce31

Please sign in to comment.