Skip to content

Commit

Permalink
add last modified date to file upload properties
Browse files Browse the repository at this point in the history
  • Loading branch information
kevodwyer committed Nov 22, 2024
1 parent 860f46a commit bb93973
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/views/Drive.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2175,10 +2175,15 @@ module.exports = {
}
let reader = new browserio.JSFileReader(file);
let java_reader = new peergos.shared.user.fs.BrowserFileReader(reader);
let jsModifiedDate = new Date(file.lastModified);
let utcJsModifiedDate = Date.UTC(jsModifiedDate.getUTCFullYear(), jsModifiedDate.getUTCMonth(),
jsModifiedDate.getUTCDate(), jsModifiedDate.getUTCHours(),
jsModifiedDate.getUTCMinutes(), jsModifiedDate.getUTCSeconds(), jsModifiedDate.getMilliseconds());
let fileModifiedDateTime = peergos.client.JsUtil.fromUtcMillis(utcJsModifiedDate);
peergos.shared.user.fs.HashTree.build(java_reader, (file.size - (file.size % Math.pow(2, 32))) / Math.pow(2, 32),
file.size, this.context.crypto.hasher).thenApply(function(hashtree) {
let fup = new peergos.shared.user.fs.FileWrapper.FileUploadProperties(file.name, {get_0: () => java_reader},
(file.size - (file.size % Math.pow(2, 32))) / Math.pow(2, 32), file.size, java.util.Optional.empty(), java.util.Optional.of(hashtree), false,
(file.size - (file.size % Math.pow(2, 32))) / Math.pow(2, 32), file.size, java.util.Optional.of(fileModifiedDateTime), java.util.Optional.of(hashtree), false,
overwriteExisting ? true : false, updateProgressBar);
let fileUploadList = uploadParams.fileUploadProperties[foundDirectoryIndex];
Expand Down

0 comments on commit bb93973

Please sign in to comment.