@@ -5,13 +5,10 @@ import { t } from '@/i18n';
55import type { MenuContext } from '@/types/contexts' ;
66import type { SyncedLyricsPluginConfig } from './types' ;
77
8- export const menu = async ( {
9- getConfig,
10- setConfig,
11- } : MenuContext < SyncedLyricsPluginConfig > ) : Promise <
8+ export const menu = async ( ctx : MenuContext < SyncedLyricsPluginConfig > ) : Promise <
129 MenuItemConstructorOptions [ ]
1310> => {
14- const config = await getConfig ( ) ;
11+ const config = await ctx . getConfig ( ) ;
1512
1613 return [
1714 {
@@ -20,7 +17,7 @@ export const menu = async ({
2017 type : 'checkbox' ,
2118 checked : config . preciseTiming ,
2219 click ( item ) {
23- setConfig ( {
20+ ctx . setConfig ( {
2421 preciseTiming : item . checked ,
2522 } ) ;
2623 } ,
@@ -40,7 +37,7 @@ export const menu = async ({
4037 type : 'radio' ,
4138 checked : config . lineEffect === 'scale' ,
4239 click ( ) {
43- setConfig ( {
40+ ctx . setConfig ( {
4441 lineEffect : 'scale' ,
4542 } ) ;
4643 } ,
@@ -55,7 +52,7 @@ export const menu = async ({
5552 type : 'radio' ,
5653 checked : config . lineEffect === 'offset' ,
5754 click ( ) {
58- setConfig ( {
55+ ctx . setConfig ( {
5956 lineEffect : 'offset' ,
6057 } ) ;
6158 } ,
@@ -70,7 +67,7 @@ export const menu = async ({
7067 type : 'radio' ,
7168 checked : config . lineEffect === 'focus' ,
7269 click ( ) {
73- setConfig ( {
70+ ctx . setConfig ( {
7471 lineEffect : 'focus' ,
7572 } ) ;
7673 } ,
@@ -87,7 +84,7 @@ export const menu = async ({
8784 type : 'radio' ,
8885 checked : config . defaultTextString === '♪' ,
8986 click ( ) {
90- setConfig ( {
87+ ctx . setConfig ( {
9188 defaultTextString : '♪' ,
9289 } ) ;
9390 } ,
@@ -97,7 +94,7 @@ export const menu = async ({
9794 type : 'radio' ,
9895 checked : config . defaultTextString === ' ' ,
9996 click ( ) {
100- setConfig ( {
97+ ctx . setConfig ( {
10198 defaultTextString : ' ' ,
10299 } ) ;
103100 } ,
@@ -107,7 +104,7 @@ export const menu = async ({
107104 type : 'radio' ,
108105 checked : config . defaultTextString === '...' ,
109106 click ( ) {
110- setConfig ( {
107+ ctx . setConfig ( {
111108 defaultTextString : '...' ,
112109 } ) ;
113110 } ,
@@ -117,7 +114,7 @@ export const menu = async ({
117114 type : 'radio' ,
118115 checked : config . defaultTextString === '———' ,
119116 click ( ) {
120- setConfig ( {
117+ ctx . setConfig ( {
121118 defaultTextString : '———' ,
122119 } ) ;
123120 } ,
@@ -130,7 +127,7 @@ export const menu = async ({
130127 type : 'checkbox' ,
131128 checked : config . showTimeCodes ,
132129 click ( item ) {
133- setConfig ( {
130+ ctx . setConfig ( {
134131 showTimeCodes : item . checked ,
135132 } ) ;
136133 } ,
@@ -143,7 +140,7 @@ export const menu = async ({
143140 type : 'checkbox' ,
144141 checked : config . showLyricsEvenIfInexact ,
145142 click ( item ) {
146- setConfig ( {
143+ ctx . setConfig ( {
147144 showLyricsEvenIfInexact : item . checked ,
148145 } ) ;
149146 } ,
0 commit comments