Skip to content

Commit

Permalink
Merge pull request espruino#3705 from BlueFox4/master
Browse files Browse the repository at this point in the history
Fixed taglauncher crashing with certain apps installed
  • Loading branch information
thyttan authored Jan 4, 2025
2 parents 08aeebc + ae2ad48 commit 6ff9693
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
1 change: 1 addition & 0 deletions apps/taglaunch/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
Add tag 'health' for apps like Heart Rate Monitor
0.04: Fix remove handler
0.05: Make the "App source not found" warning less buggy
0.06: Fixed a crash if an app has no tags (app.tags is undefined)
17 changes: 16 additions & 1 deletion apps/taglaunch/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Launcher
Tag Launcher
========

Based on the default launcher but puts all applications in a submenu by their tag.
Expand All @@ -13,3 +13,18 @@ Settings
- `Vector Font Size` - The size of the font if `Font` is set to `Vector`. Default `10`.
- `Show Clocks` - If set to `No` then clocks won't appear in the app list. Default `Yes`.
- `Fullscreen` - If set to `Yes` then widgets won't be loaded. Default `No`.


Acknowledgements
========

Creator
--------

[nxdefiant](https://github.com/nxdefiant)

Contributors
--------

- [atjn](https://github.com/atjn)
- [BlueFox4](https://github.com/BlueFox4)
21 changes: 13 additions & 8 deletions apps/taglaunch/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,20 @@ if (launchCache.hash!=launchHash) {
.filter(app=>app && app.type=="app" || app.type=="clock" || !app.type)
.sort((a,b)=>sort(a,b))
.forEach(app => {
let appTags = app.tags.split(",")
.map(tag => tag.trim())
.map(tag => tag === "tools" ? "tool" : tag) // tool = tools
.filter(tag => Object.keys(tags).includes(tag));
if (appTags.length === 0) {
let appTags = [];
if (!app.tags) {
appTags.push("misc");
} else if (appTags.length > 1 && appTags.indexOf("tool") >= 0) {
// everything has tag 'tool', unregister when at least one other known tag
appTags.splice(appTags.indexOf("tool"), 1);
} else {
appTags = app.tags.split(",")
.map(tag => tag.trim())
.map(tag => tag === "tools" ? "tool" : tag) // tool = tools
.filter(tag => Object.keys(tags).includes(tag));
if (appTags.length === 0) {
appTags.push("misc");
} else if (appTags.length > 1 && appTags.indexOf("tool") >= 0) {
// everything has tag 'tool', unregister when at least one other known tag
appTags.splice(appTags.indexOf("tool"), 1);
}
}
appTags.forEach(tag => appsByTag[tag].push(app));
});
Expand Down
2 changes: 1 addition & 1 deletion apps/taglaunch/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "taglaunch",
"name": "Tag Launcher",
"shortName": "Taglauncher",
"version": "0.05",
"version": "0.06",
"description": "Launcher that puts all applications into submenus based on their tag. With many applications installed this can result in a faster application selection than the linear access of the default launcher.",
"readme": "README.md",
"icon": "app.png",
Expand Down

0 comments on commit 6ff9693

Please sign in to comment.