mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-12 23:20:25 +08:00
added error message when ss couldnt be saved
This commit is contained in:
parent
6455a6ec81
commit
38bf4c1eef
1 changed files with 6 additions and 10 deletions
|
@ -72,17 +72,13 @@ function copyResultToClipboard() {
|
|||
}).then(function(canvas) {
|
||||
// document.body.appendChild(canvas);
|
||||
canvas.toBlob(function(blob) {
|
||||
navigator.clipboard
|
||||
.write([
|
||||
new ClipboardItem(
|
||||
Object.defineProperty({}, blob.type, {
|
||||
value: blob,
|
||||
enumerable: true
|
||||
})
|
||||
)
|
||||
])
|
||||
let data = [new ClipboardItem({ [blob.type]: blob })];
|
||||
navigator.clipboard.write(data).then(f => {
|
||||
showNotification('Copied to clipboard',1000);
|
||||
}).catch(f => {
|
||||
showNotification('Error saving image to clipboard',2000);
|
||||
})
|
||||
});
|
||||
showNotification('Copied to clipboard',1000);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue