Skip to content

Commit 8c2a893

Browse files
fix bug in error checking between snapshot and downloadImage
1 parent 794dfd6 commit 8c2a893

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/components/modebar/buttons.js

+7-9
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,15 @@ modeBarButtons.toImage = {
5555
return;
5656
}
5757

58-
if(gd._snapshotInProgress) {
59-
Lib.notifier('Snapshotting is still in progress - please hold', 'long');
60-
return;
61-
}
62-
63-
gd._snapshotInProgress = true;
6458
Lib.notifier('Taking snapshot - this may take a few seconds', 'long');
6559

66-
downloadImage(gd).catch(function() {
67-
Lib.notifier('Sorry there was a problem downloading your snapshot', 'long');
68-
});
60+
downloadImage(gd)
61+
.then(function(filename){
62+
Lib.notifier('Snapshot succeeded - ' + filename);
63+
})
64+
.catch(function(err) {
65+
Lib.notifier('Sorry there was a problem downloading your snapshot', 'long');
66+
});
6967
}
7068
};
7169

src/snapshot/download.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ function downloadImage(gd, opts) {
3030

3131
return new Promise(function(resolve,reject) {
3232
if(gd._snapshotInProgress) {
33-
reject(new Error('Snapshotting is unavailable in Internet Explorer. ' +
34-
'Consider exporting your images using the Plotly Cloud'));
33+
reject(new Error('Snapshotting already in progress.'));
3534
}
3635

3736
gd._snapshotInProgress = true;

0 commit comments

Comments
 (0)