fix(viewer): used join to fix issues stemming from #2991 #3004
  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.
  
    
  
    
While the fix merged in #2991 addressed a share, it inadvertently broke navigating through images for regular file viewing (non-shares). This fix uses the
join,dirPathandnode.basenameto reconstruct the paths that works for both shares and non-shared views.I've tested this lean version of the nextcloud-docker-dev repo as of 2025-Oct-27 for (1) regular file navigation, (2) the root of a share for images and (3) within subfolders for the share. The check for length 0 is needed for images in the root of a share. Originally, the dirPath evaluated to
/but now it evaluates to an empty string.Sorry @skjnldsv about the headache that this has caused.