mirror of
https://github.com/WowUp/WowUp.git
synced 2026-04-23 15:27:03 -04:00
Fix #584
This commit is contained in:
@@ -11,6 +11,7 @@ export interface AddonProvider {
|
||||
forceIgnore: boolean;
|
||||
allowReinstall: boolean;
|
||||
allowChannelChange: boolean;
|
||||
allowEdit: boolean;
|
||||
|
||||
getAll(clientType: WowClientType, addonIds: string[]): Promise<AddonSearchResult[]>;
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ export class CurseAddonProvider implements AddonProvider {
|
||||
public readonly forceIgnore = false;
|
||||
public readonly allowReinstall = true;
|
||||
public readonly allowChannelChange = true;
|
||||
public readonly allowEdit = true;
|
||||
public enabled = true;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -27,6 +27,7 @@ export class GitHubAddonProvider implements AddonProvider {
|
||||
public readonly forceIgnore = false;
|
||||
public readonly allowReinstall = true;
|
||||
public readonly allowChannelChange = false;
|
||||
public readonly allowEdit = false;
|
||||
public enabled = true;
|
||||
|
||||
constructor(private _httpClient: HttpClient) {}
|
||||
|
||||
@@ -20,6 +20,7 @@ export class RaiderIoAddonProvider implements AddonProvider {
|
||||
public readonly forceIgnore = true;
|
||||
public readonly allowReinstall = false;
|
||||
public readonly allowChannelChange = false;
|
||||
public readonly allowEdit = false;
|
||||
public enabled = true;
|
||||
|
||||
constructor() {}
|
||||
|
||||
@@ -29,6 +29,7 @@ export class TukUiAddonProvider implements AddonProvider {
|
||||
public readonly forceIgnore = false;
|
||||
public readonly allowReinstall = true;
|
||||
public readonly allowChannelChange = false;
|
||||
public readonly allowEdit = true;
|
||||
public enabled = true;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -27,6 +27,7 @@ export class WowInterfaceAddonProvider implements AddonProvider {
|
||||
public readonly forceIgnore = false;
|
||||
public readonly allowReinstall = true;
|
||||
public readonly allowChannelChange = false;
|
||||
public readonly allowEdit = true;
|
||||
public enabled = true;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -37,6 +37,7 @@ export class WowUpAddonProvider implements AddonProvider {
|
||||
public readonly forceIgnore = false;
|
||||
public readonly allowReinstall = true;
|
||||
public readonly allowChannelChange = false;
|
||||
public readonly allowEdit = true;
|
||||
public enabled = true;
|
||||
|
||||
constructor(private _httpClient: HttpClient, private _electronService: ElectronService) {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { MatSelectChange } from "@angular/material/select";
|
||||
import { FormControl } from "@angular/forms";
|
||||
import { find } from "lodash";
|
||||
import { filter } from "lodash";
|
||||
import { WowUpService } from "../../services/wowup/wowup.service";
|
||||
import { AddonService } from "../../services/addons/addon.service";
|
||||
import { AddonProviderState } from "../../models/wowup/addon-provider-state";
|
||||
@@ -19,7 +19,7 @@ export class OptionsAddonSectionComponent implements OnInit {
|
||||
constructor(private _addonService: AddonService, private _wowupService: WowUpService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.addonProviderStates = this._addonService.getAddonProviderStates();
|
||||
this.addonProviderStates = filter(this._addonService.getAddonProviderStates(), (provider) => provider.canEdit);
|
||||
this.enabledAddonProviders.setValue(this.getEnabledProviderNames());
|
||||
console.debug("addonProviderStates", this.addonProviderStates);
|
||||
}
|
||||
@@ -27,7 +27,11 @@ export class OptionsAddonSectionComponent implements OnInit {
|
||||
public onProviderStateSelectionChange(event: MatSelectionListChange) {
|
||||
console.debug(event);
|
||||
event.options.forEach((option) => {
|
||||
this._wowupService.setAddonProviderState({ providerName: option.value, enabled: option.selected });
|
||||
this._wowupService.setAddonProviderState({
|
||||
providerName: option.value,
|
||||
enabled: option.selected,
|
||||
canEdit: true,
|
||||
});
|
||||
this._addonService.setProviderEnabled(option.value, option.selected);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export interface AddonProviderState {
|
||||
providerName: string;
|
||||
enabled: boolean;
|
||||
canEdit: boolean;
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ export class AddonService {
|
||||
return {
|
||||
providerName: provider.name,
|
||||
enabled: provider.enabled,
|
||||
canEdit: provider.allowEdit,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user