Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #220 from mgilangjanuar/staging
Browse files Browse the repository at this point in the history
hotfix: get user_id in view page
  • Loading branch information
mgilangjanuar authored Jan 20, 2022
2 parents 456e718 + 47965c7 commit 1965430
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/pages/View.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const View: React.FC<PageProps> = ({ match }) => {
const history = useHistory()
const { data, error, mutate } = useSWR(`/files/${match.params.id}`, fetcher)
const { data: user } = useSWRImmutable(data?.file ? `/users/${data.file.user_id}` : null, fetcher)
const { data: datafilesParts } = useSWR(data?.file.name && /\.part0*\d+$/.test(data.file.name) ? `/files?name.match=${encodeURIComponent('\.part0*[0-9]+$')}&name.like=${data.file.name.replace(/\.part0*\d+$/, '')}%&user_id=${user.user.id}&shared=1&parent_id${data.file.parent_id ? `=${data.file.parent_id}` : '.is=null'}` : null, fetcher)
const { data: datafilesParts } = useSWR(data?.file.name && /\.part0*\d+$/.test(data.file.name) ? `/files?name.match=${encodeURIComponent('\.part0*[0-9]+$')}&name.like=${data.file.name.replace(/\.part0*\d+$/, '')}%&user_id=${data.file.user_id}&shared=1&parent_id${data.file.parent_id ? `=${data.file.parent_id}` : '.is=null'}` : null, fetcher)
const [links, setLinks] = useState<{ raw: string, download: string, share: string }>()
const [showContent] = useDebounce(collapsed, 250)
const [contentStyle, setContentStyle] = useState<{ display: string } | undefined>()
Expand Down

0 comments on commit 1965430

Please sign in to comment.