Skip to content
Open
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
9 changes: 8 additions & 1 deletion src/view/FilesAppIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default {
const newFileModel = oldFile.clone()
newFileModel.set('id', node.fileid)
newFileModel.set('name', newName)
newFileModel.set('mtime', Date.now())
newFileModel.set('mtime', node.mtime?.getTime())
this.getFileList()
.add(newFileModel.toJSON())
}
Expand Down Expand Up @@ -487,6 +487,13 @@ export default {
}
},

async refreshFileInfo() {
const node = await this.getFileNode(true)
if (node) {
emit('files:node:updated', node)
}
},

async updateFileInfo(name, mtime) {
const node = await this.getFileNode()

Expand Down
14 changes: 3 additions & 11 deletions src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ export default {
close() {
FilesAppIntegration.close()
if (this.modified) {
FilesAppIntegration.updateFileInfo(undefined, Date.now())
FilesAppIntegration.refreshFileInfo()
}
disableScrollLock()
this.restoreFavicon()
Expand Down Expand Up @@ -526,7 +526,7 @@ export default {
this.switchToSavedAsFile(newFileName)
} else {
// When saving the current file, update its modification time
FilesAppIntegration.updateFileInfo(undefined, Date.now())
FilesAppIntegration.refreshFileInfo()
}
}
break
Expand Down Expand Up @@ -580,19 +580,11 @@ export default {
case 'Action_GetLinkPreview':
this.resolveLink(args.url)
break
case 'Action_Save':
if (this.modified) {
FilesAppIntegration.updateFileInfo(undefined, Date.now())
}
break
case 'UI_Save':
FilesAppIntegration.updateFileInfo(undefined, Date.now())
break
case 'Clicked_Button':
this.buttonClicked(args)
break
case 'Doc_ModifiedStatus':
if (args.Modified !== this.modified && !this.openingLocally) {
if (this.modified && !args.Modified && !this.openingLocally) {
FilesAppIntegration.updateFileInfo(undefined, Date.now())
}
this.modified = args.Modified
Expand Down
Loading