File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,9 +98,11 @@ export async function restoreVersion(version: Version) {
9898 */
9999function formatVersion ( version : Required < FileStat > , node : INode ) : Version {
100100 const mtime = Date . parse ( version . lastmod )
101+ // server timestamps are seconds-based, we have to nullify the milliseconds
102+ const nodeNormalizedMtime = Math . floor ( ( node . mtime ?. getTime ( ) ?? 0 ) / 1000 ) * 1000
101103
102104 let previewUrl : string
103- if ( mtime === node . mtime ?. getTime ( ) ) { // Version is the current one
105+ if ( mtime === nodeNormalizedMtime ) { // Version is the current one
104106 previewUrl = generateUrl ( '/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0&forceIcon=1&mimeFallback=1' , {
105107 fileId : node . id ,
106108 fileEtag : node . attributes . etag ,
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ const loading = ref(false)
7373const showVersionLabelForm = ref (false )
7474const editedVersion = ref <Version | null >(null )
7575
76- const currentVersionMtime = computed (() => props .node ?.mtime ?.getTime () ?? 0 )
76+ const currentVersionMtime = computed (() => Math . floor ( new Date ( props .node ?.mtime ?.getTime () ?? 0 ). getTime () / 1000 ) * 1000 )
7777
7878/**
7979 * Order versions by mtime.
You can’t perform that action at this time.
0 commit comments