Make Blacklist class
This commit is contained in:
parent
574692551a
commit
b86b4680b6
12 changed files with 139 additions and 149 deletions
|
@ -1,8 +1,6 @@
|
|||
import { injectable } from 'tsyringe';
|
||||
import AddonEnabledUseCase from '../usecases/AddonEnabledUseCase';
|
||||
import SettingUseCase from '../usecases/SettingUseCase';
|
||||
import * as blacklists from '../../shared/blacklists';
|
||||
|
||||
import * as messages from '../../shared/messages';
|
||||
|
||||
@injectable()
|
||||
|
@ -17,9 +15,7 @@ export default class SettingController {
|
|||
async initSettings(): Promise<void> {
|
||||
try {
|
||||
let current = await this.settingUseCase.reload();
|
||||
let disabled = blacklists.includes(
|
||||
current.blacklist, window.location.href,
|
||||
);
|
||||
let disabled = current.blacklist.includes(window.location.href);
|
||||
if (disabled) {
|
||||
this.addonEnabledUseCase.disable();
|
||||
} else {
|
||||
|
|
Reference in a new issue