Skip to content

Commit

Permalink
fix bug preventing uploading the same large file twice
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky authored and AndyScherzinger committed Jan 31, 2017
1 parent dbd3421 commit e92f4b3
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ protected int uploadFile(OwnCloudClient client) throws IOException {
}

} finally {
SharedPreferences.Editor editor = sharedPref.edit();
editor.putStringSet(chunkId, successfulChunks).apply();
if (this.isSuccess(status)) {
SharedPreferences.Editor editor = sharedPref.edit();
editor.remove(chunkId).apply();
} else {
SharedPreferences.Editor editor = sharedPref.edit();
editor.putStringSet(chunkId, successfulChunks).apply();
}

if (channel != null)
channel.close();
Expand Down

0 comments on commit e92f4b3

Please sign in to comment.