Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions demo/js/qiniu.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,17 @@ function QiniuJsSDK() {
var aDay = 24 * 60 * 60 * 1000; // milliseconds
if (now - before < aDay) {
if (localFileInfo.percent !== 100) {
file.percent = localFileInfo.percent;
file.loaded = localFileInfo.offset;
ctx = localFileInfo.ctx;
if (localFileInfo.offset + blockSize > file.size) {
blockSize = file.size - localFileInfo.offset;
if (file.size === localStorage.total) {
file.percent = localFileInfo.percent;
file.loaded = localFileInfo.offset;
ctx = localFileInfo.ctx;
if (localFileInfo.offset + blockSize > file.size) {
blockSize = file.size - localFileInfo.offset;
}
} else {
localStorage.removeItem(file.name);
}

} else {
// 进度100%时,删除对应的localStorage,避免 499 bug
localStorage.removeItem(file.name);
Expand Down
15 changes: 10 additions & 5 deletions src/qiniu.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,17 @@ function QiniuJsSDK() {
var aDay = 24 * 60 * 60 * 1000; // milliseconds
if (now - before < aDay) {
if (localFileInfo.percent !== 100) {
file.percent = localFileInfo.percent;
file.loaded = localFileInfo.offset;
ctx = localFileInfo.ctx;
if (localFileInfo.offset + blockSize > file.size) {
blockSize = file.size - localFileInfo.offset;
if (file.size === localStorage.total) {
file.percent = localFileInfo.percent;
file.loaded = localFileInfo.offset;
ctx = localFileInfo.ctx;
if (localFileInfo.offset + blockSize > file.size) {
blockSize = file.size - localFileInfo.offset;
}
} else {
localStorage.removeItem(file.name);
}

} else {
// 进度100%时,删除对应的localStorage,避免 499 bug
localStorage.removeItem(file.name);
Expand Down
Loading