Skip to content

Commit

Permalink
fix(files_versions): renaming file version when its not a string
Browse files Browse the repository at this point in the history
Signed-off-by: Sanskar Soni <sanskarsoni300@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
sanskar-soni-9 authored and susnux committed Jul 9, 2024
1 parent 263524b commit 75342d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion apps/files_versions/src/utils/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ function formatVersion(version: any, fileInfo: any): Version {

return {
fileId: fileInfo.id,
label: version.props['version-label'],
// If version-label is defined make sure it is a string (prevent issue if the label is a number an PHP returns a number then)
label: version.props['version-label'] && String(version.props['version-label']),
author: version.props['version-author'] ?? null,
filename: version.filename,
basename: moment(mtime).format('LLL'),
Expand Down
4 changes: 2 additions & 2 deletions dist/files_versions-files_versions.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_versions-files_versions.js.map

Large diffs are not rendered by default.

0 comments on commit 75342d6

Please sign in to comment.