Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
remove duplicate drawWindow call for shot preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Niharika Khanna committed Jul 27, 2017
1 parent 06a45c6 commit 2a5dd27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions addon/webextension/selector/shooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ this.shooter = (function() { // eslint-disable-line no-unused-vars

let isSaving = null;

exports.takeShot = function(captureType, selectedPos) {
exports.takeShot = function(captureType, selectedPos, url) {
// isSaving indicates we're aleady in the middle of saving
// we use a timeout so in the case of a failure the button will
// still start working again
Expand Down Expand Up @@ -92,7 +92,7 @@ this.shooter = (function() { // eslint-disable-line no-unused-vars
if (buildSettings.captureText) {
captureText = util.captureEnclosedText(selectedPos);
}
let dataUrl = screenshotPage(selectedPos);
let dataUrl = url || screenshotPage(selectedPos);
if (dataUrl) {
shotObject.delAllClips();
shotObject.addClip({
Expand Down
2 changes: 1 addition & 1 deletion addon/webextension/selector/uicontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ this.uicontrol = (function() {
},
onSavePreview: () => {
sendEvent(`save-${captureType.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()}`, "save-preview-button");
shooter.takeShot(captureType, selectedPos);
shooter.takeShot(captureType, selectedPos, dataUrl);
},
onDownloadPreview: () => {
sendEvent(`download-${captureType.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()}`, "download-preview-button");
Expand Down

0 comments on commit 2a5dd27

Please sign in to comment.