Ran formatter, removed unused array and updated APIModel.ts

This commit is contained in:
ltctceplrm 2024-03-16 14:18:14 +01:00
parent f52060482a
commit 5eec98d127
8 changed files with 44 additions and 45 deletions

View file

@ -1,5 +1,6 @@
import { MediaTypeModel } from '../models/MediaTypeModel';
import { MediaType } from '../utils/MediaType';
import { MediaDbPluginSettings } from 'src/settings/Settings';
import MediaDbPlugin from '../main';
export abstract class APIModel {
@ -19,7 +20,7 @@ export abstract class APIModel {
abstract getById(id: string): Promise<MediaTypeModel>;
hasType(type: MediaType): boolean {
if (this.types.contains(type) && !(this.plugin.settings[[this.apiName, type].filter(s => s).join('') as keyof typeof this.plugin.settings] === false)){
if (this.types.contains(type) && !(this.plugin.settings[(this.apiName + type) as keyof MediaDbPluginSettings] === false)) {
return true;
}
}

View file

@ -76,7 +76,6 @@ export class MediaDbSearchModal extends Modal {
const placeholder = 'Search by title';
const searchComponent = new TextComponent(contentEl);
const toggleComponents = [];
let currentToggle: ToggleComponent = null;
searchComponent.inputEl.style.width = '100%';
@ -119,7 +118,6 @@ export class MediaDbSearchModal extends Modal {
}
});
apiToggleComponentWrapper.appendChild(apiToggleComponent.toggleEl);
toggleComponents.push(apiToggleComponent);
}
contentEl.createDiv({ cls: 'media-db-plugin-spacer' });