11import axios from 'axios' ;
22import { MsgCenter } from '@App/apps/msg-center/msg-center' ;
3- import { AppEvent , ScriptExec , ScriptRunStatusChange , ScriptStatusChange , ScriptStop , ScriptUninstall , ScriptReinstall , ScriptValueChange , TabRemove , RequestTabRunScript , ScriptInstall , RequestInstallInfo , ScriptCheckUpdate , RequestConfirmInfo , ListenGmLog , SubscribeUpdate , Unsubscribe , SubscribeCheckUpdate , ImportFile , OpenImportFileWindow , RequestImportFile , ScriptInstallByURL } from '@App/apps/msg-center/event' ;
3+ import { AppEvent , ScriptExec , ScriptRunStatusChange , ScriptStatusChange , ScriptStop , ScriptUninstall , ScriptReinstall , ScriptValueChange , TabRemove , RequestTabRunScript , ScriptInstall , RequestInstallInfo , ScriptCheckUpdate , RequestConfirmInfo , ListenGmLog , SubscribeUpdate , Unsubscribe , SubscribeCheckUpdate , OpenImportFileWindow , RequestImportFile , ScriptInstallByURL } from '@App/apps/msg-center/event' ;
44import { dealScript , get , randomString } from '@App/pkg/utils/utils' ;
55import { App } from '../app' ;
66import { UrlMatch } from '@App/pkg/match' ;
@@ -19,7 +19,6 @@ import { Subscribe } from '@App/model/do/subscribe';
1919import { SubscribeModel } from '@App/model/subscribe' ;
2020import { SyncModel } from '@App/model/sync' ;
2121import { SyncAction , SyncData } from '@App/model/do/sync' ;
22- import { ExportFile } from '@App/model/do/backup' ;
2322import { v4 as uuidv4 } from 'uuid' ;
2423import { Manager } from '@App/pkg/apps/manager' ;
2524
@@ -103,7 +102,6 @@ export class ScriptManager extends Manager {
103102 this . listenerMessage ( SubscribeCheckUpdate , this . subscribeCheckUpdate ) ;
104103
105104 this . listenerMessage ( OpenImportFileWindow , this . openImportFileWindow )
106- this . listenerMessage ( ImportFile , this . importFile )
107105 this . listenerMessage ( RequestImportFile , this . requestImportFile )
108106
109107 // 监听事件,并转发
@@ -196,11 +194,11 @@ export class ScriptManager extends Manager {
196194 } ) ;
197195 }
198196
199- public openImportFileWindow ( file : ExportFile ) : Promise < any > {
197+ public openImportFileWindow ( file : { name : string , url : string } ) : Promise < any > {
200198 return new Promise ( resolve => {
201199 // 打开导入窗口
202200 const uuid = uuidv4 ( )
203- App . Cache . set ( 'import:info:' + uuid , file ) ;
201+ void App . Cache . set ( 'import:info:' + uuid , file ) ;
204202 chrome . tabs . create ( {
205203 url : 'import.html?uuid=' + uuid ,
206204 active : true ,
@@ -209,15 +207,7 @@ export class ScriptManager extends Manager {
209207 } ) ;
210208 }
211209
212- public importFile ( file : ExportFile ) : Promise < any > {
213- return new Promise ( resolve => {
214-
215-
216- resolve ( true ) ;
217- } ) ;
218- }
219-
220- public requestImportFile ( uuid : string ) : Promise < ExportFile > {
210+ public requestImportFile ( uuid : string ) : Promise < any > {
221211 return new Promise ( resolve => {
222212 const file = App . Cache . get ( 'import:info:' + uuid ) ;
223213 resolve ( file ) ;
0 commit comments