backswipe:fix could not blcklist messagegui.new.js

pull/3391/head
thyttan 2024-04-29 19:02:29 +02:00
parent d2b1487315
commit c90bb4910f
4 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,6 @@
0.01: New App! 0.01: New App!
0.02: Don't fire if the app uses swipes already. 0.02: Don't fire if the app uses swipes already.
0.03: Only count defined handlers in the handler array. 0.03: Only count defined handlers in the handler array.
0.04: Fix messages auto opened by `messagegui` could not be blacklisted. Needs
a refresh by deselecting and reselecting the "Messages" app throught Back Swipe
settings.

View File

@ -47,9 +47,9 @@
function enabledForApp(app) { function enabledForApp(app) {
if (!settings) return true; if (!settings) return true;
if (settings.mode === 0) { if (settings.mode === 0) {
return !(settings.apps.filter((a) => a.src === app).length > 0); return !(settings.apps.filter((a) => (a.src===app)||(a.files&&a.files.includes(app))).length > 0); // The `a.src===app` and `a.files&&...` checks are for backwards compatibility. Otherwise only `a.files.includes(app)` is needed.
} else if (settings.mode === 1) { } else if (settings.mode === 1) {
return settings.apps.filter((a) => a.src === app).length > 0; return settings.apps.filter((a) => (a.src===app)||(a.files&&a.files.includes(app))).length > 0;
} else { } else {
return settings.mode === 2 ? true : false; return settings.mode === 2 ? true : false;
} }

View File

@ -1,7 +1,7 @@
{ "id": "backswipe", { "id": "backswipe",
"name": "Back Swipe", "name": "Back Swipe",
"shortName":"BackSwipe", "shortName":"BackSwipe",
"version":"0.03", "version":"0.04",
"description": "Service that allows you to use an app's back button using left to right swipe gesture", "description": "Service that allows you to use an app's back button using left to right swipe gesture",
"icon": "app.png", "icon": "app.png",
"tags": "back,gesture,swipe", "tags": "back,gesture,swipe",

View File

@ -26,7 +26,8 @@
return appInfo && { return appInfo && {
'name': appInfo.name, 'name': appInfo.name,
'sortorder': appInfo.sortorder, 'sortorder': appInfo.sortorder,
'src': appInfo.src 'src': appInfo.src,
'files': appInfo.files
}; };
}).filter(app => app && !!app.src); }).filter(app => app && !!app.src);
apps.sort((a, b) => { apps.sort((a, b) => {