code optimize
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { ACTION_UPLOAD_STATE } from '../common';
|
||||
import { Request, Actions } from '../common';
|
||||
|
||||
window.onload = function () {
|
||||
document.querySelector('#link-extension-detail')
|
||||
@ -21,10 +21,10 @@ window.onload = function () {
|
||||
reader.readAsText(this.files[0], "UTF-8");
|
||||
reader.onload = function (evt) {
|
||||
var fileString = evt.target.result;
|
||||
chrome.runtime.sendMessage({
|
||||
action: ACTION_UPLOAD_STATE,
|
||||
chrome.runtime.sendMessage(<Request>{
|
||||
action: Actions.UPLOAD_STATE,
|
||||
state: fileString,
|
||||
name: fileName
|
||||
fileName: fileName
|
||||
}, r => {
|
||||
if (r) console.log('State sent:', r);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user