feat(ui): simplify plugin activation and align task status badges
This commit is contained in:
1 parent
9c82a40cbf
commit
96fedc816f
11 files changed
+242
-31
No files matched your search
@@ -28,6 +28,7 @@ export class TaskPluginsComponent {
|
||||
return this.plugins().filter(p => p.enabled && p.profiles.some(profile => profile.authorized) &&
|
||||
p.manifest.targets.some(target => target === 'android' || target === 'mixed'));
|
||||
}
|
||||
authorizedProfiles(plugin: InstalledPlugin) { return plugin.profiles.filter(p => p.authorized); }
|
||||
toggle() {
|
||||
this.open.update(v => !v);
|
||||
if (this.open()) this.load();
|
||||
@@ -41,7 +42,7 @@ export class TaskPluginsComponent {
|
||||
}
|
||||
choose(plugin: InstalledPlugin, event: Event) {
|
||||
if ((event.target as HTMLInputElement).checked) {
|
||||
const profiles = plugin.profiles.filter(p => p.authorized);
|
||||
const profiles = this.authorizedProfiles(plugin);
|
||||
this.selected[plugin.manifest.id] = (profiles.find(p => p.is_default) || profiles[0]).name;
|
||||
} else delete this.selected[plugin.manifest.id];
|
||||
this.emit();
|
||||
|
||||
Reference in new issue
Block a user