Skip to content

Commit

Permalink
can cancel paused
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Jul 13, 2017
1 parent 3ea0130 commit 46e9e87
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/cos-js-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -15275,7 +15275,7 @@ var initTask = function (cos) {
var task = tasks[id];
var waiting = task && task.state === 'waiting';
var running = task && (task.state === 'checking' || task.state === 'uploading');
if (waiting || running) {
if (waiting || running || switchToState === 'canceled' && task.state === 'paused') {
if (switchToState === 'paused' && task.params.Body && typeof task.params.Body.pipe === 'function') {
console.error('stream not support pause');
return;
Expand All @@ -15287,7 +15287,7 @@ var initTask = function (cos) {
uploadingFileCount--;
startNextTask(cos);
}
if (switchToState === 'cancel') {
if (switchToState === 'canceled') {
delete task.params;
delete task.callback;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cos-js-sdk-v5.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var initTask = function (cos) {
var task = tasks[id];
var waiting = task && task.state === 'waiting';
var running = task && (task.state === 'checking' || task.state === 'uploading');
if (waiting || running) {
if (waiting || running || (switchToState === 'canceled' && task.state === 'paused')) {
if (switchToState === 'paused' && task.params.Body && typeof task.params.Body.pipe === 'function') {
console.error('stream not support pause');
return;
Expand All @@ -68,7 +68,7 @@ var initTask = function (cos) {
uploadingFileCount--;
startNextTask(cos);
}
if (switchToState === 'cancel') {
if (switchToState === 'canceled') {
delete task.params;
delete task.callback;
}
Expand Down

0 comments on commit 46e9e87

Please sign in to comment.