Open the file when the fileid changes and openfile is set#45569
Closed
Open the file when the fileid changes and openfile is set#45569
Conversation
Contributor
Author
|
/backport to stable29 |
Contributor
Author
|
/backport to stable28 |
When opening a file, the `openfile` query parameter is set to true. This stays in the URL even after the viewer was closed. After that, when creating a new file, the file id in the URL changes, but the `openfile` parameter stays to true. This does not triggers the watcher: https://github.com/nextcloud/server/blob/a5fd623469b40c44881e4635de073d334b371bae/apps/files/src/components/FilesListVirtual.vue#L199. If we want to automatically open newly created files, then we need to either check the `openfile` value in the `fileId` watcher, or reset the `openfile` parameter to false when the Viewer is closed. I am not sure whther we want the `openfile` parameter to be reset when the Viewer is closed, so I went for the first solution. Signed-off-by: Louis Chemineau <louis@chmn.me>
8a52b5d to
a06b7f4
Compare
susnux
reviewed
May 29, 2024
Contributor
susnux
left a comment
There was a problem hiding this comment.
what happens if fileId and openFile change in the same tick?
Member
I think we used to, it should definitely be the case. |
Contributor
Author
|
Replaced by nextcloud/viewer#2322 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When opening a file, the
openfilequery parameter is set to true. This stays in the URL even after the viewer was closed.After that, when creating a new file, the
fileIdin the URL changes, but theopenfileparameter stays to true. This does not trigger the watcher:server/apps/files/src/components/FilesListVirtual.vue
Lines 196 to 200 in a5fd623
If we want to automatically open newly created files, then we need to either:
openfilevalue in thefileIdwatcher:server/apps/files/src/components/FilesListVirtual.vue
Lines 192 to 194 in a5fd623
openfileparameter to false when the Viewer is closedI am not sure whether we want the
openfileparameter to be reset when the Viewer is closed, so I went for the first solution.Fix #45486