feat: migration to TypeScript part 2

Co-authored-by: Su-Yong <simssy2205@gmail.com>
This commit is contained in:
JellyBrick
2023-09-03 06:37:47 +09:00
parent 82bcadcd64
commit d30755e5fa
40 changed files with 523 additions and 296 deletions

View File

@ -1,3 +1,6 @@
/* eslint-disable @typescript-eslint/await-thenable */
/* renderer */
import { PluginConfig } from '../../config/dynamic';
const config = new PluginConfig('adblocker', { enableFront: true });

View File

@ -1,15 +1,13 @@
import config from './config';
export default async () => {
const blockerConfig = await config.get('blocker');
import config, { blockers } from './config';
export default () => {
return [
{
label: 'Blocker',
submenu: Object.values(config.blockers).map((blocker) => ({
submenu: Object.values(blockers).map((blocker: string) => ({
label: blocker,
type: 'radio',
checked: (blockerConfig || config.blockers.WithBlocklists) === blocker,
checked: (config.get('blocker') || blockers.WithBlocklists) === blocker,
click() {
config.set('blocker', blocker);
},