Fixed: progress display when upload from clipboard

This commit is contained in:
Molunerfinn
2018-11-29 11:14:45 +08:00
parent 9c12fb6ede
commit 9d979a2b04
2 changed files with 3 additions and 33 deletions

View File

@@ -63,26 +63,7 @@ const waitForRename = (window, id) => {
const uploader = (img, type, webContents) => {
const picgo = new PicGo(CONFIG_PATH)
picgo.config.debug = true
let input = []
switch (type) {
case 'imgFromClipboard':
if (img !== null) {
const today = dayjs().format('YYYYMMDDHHmmss') + '.png'
input = [
{
base64Image: img.imgUrl.replace(/^data\S+,/, ''),
fileName: today,
width: img.width,
height: img.height,
extname: '.png'
}
]
}
break
default:
input = img
break
}
let input = img
picgo.helper.beforeUploadPlugins.register('renameFn', {
handle: async ctx => {