Skip to content

Commit

Permalink
fix: Open public note inside shared cozy to cozy folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cballevre committed Nov 18, 2024
1 parent 07917d0 commit c5b8947
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/modules/navigation/PublicNoteRedirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ const PublicNoteRedirect: FC = () => {
useEffect(() => {
const fetchNoteUrl = async (fileId: string): Promise<void> => {
setFetchStatus('loading')

try {
// Inside notes, we need to add / at the end of /public/ or /preview/ to avoid 409 error
const pathname =
location.pathname === '/'
? '/public/'
: joinPath(location.pathname, '')
const url = await fetchURL(
client,
{
id: fileId
},
{
pathname: joinPath(location.pathname, '')
pathname
}
)
setNoteUrl(url)
Expand Down

0 comments on commit c5b8947

Please sign in to comment.