Added: globalshotcut for clipboard upload

This commit is contained in:
Molunerfinn
2017-12-23 19:46:20 +08:00
parent 7ada9fec39
commit a8a0b9b424
3 changed files with 53 additions and 10 deletions

View File

@@ -21,13 +21,15 @@ const imgFromPath = async (imgPath) => {
const imgFromClipboard = (file) => {
let result = []
const today = new Date().toLocaleString().replace(/[ ]+/g, '-')
result.push({
base64Image: file.imgUrl.replace(/^data\S+,/, ''),
fileName: `${today}.png`,
width: file.width,
height: file.height
})
if (file !== null) {
const today = new Date().toLocaleString().replace(/[ ]+/g, '-').replace(/\/+/g, '-')
result.push({
base64Image: file.imgUrl.replace(/^data\S+,/, ''),
fileName: `${today}.png`,
width: file.width,
height: file.height
})
}
return result
}