Skip to content

Commit

Permalink
Fix bug where setting share password would print error
Browse files Browse the repository at this point in the history
This solves #133
  • Loading branch information
viktorstrate committed Nov 17, 2020
1 parent 514d9b1 commit d7ed03c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ui/src/Pages/SharePage/SharePage.js
Expand Up @@ -176,6 +176,7 @@ const TokenRoute = ({ match }) => {
const { loading, error, data, refetch } = useQuery(
VALIDATE_TOKEN_PASSWORD_QUERY,
{
notifyOnNetworkStatusChange: true,
variables: {
token: match.params.token,
password: getSharePassword(match.params.token),
Expand All @@ -202,7 +203,7 @@ const TokenRoute = ({ match }) => {
match={match}
refetchWithPassword={password => {
saveSharePassword(token, password)
refetch({ variables: { password } })
refetch({ token, password })
}}
loading={loading}
/>
Expand Down
1 change: 1 addition & 0 deletions ui/src/components/sidebar/Sharing.js
Expand Up @@ -115,6 +115,7 @@ const ShareItemMoreDropdown = ({ id, share, isPhoto }) => {
event.preventDefault()
setPassword({
variables: {
token: share.token,
password: event.target.value,
},
})
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/sidebar/SidebarDownload.js
Expand Up @@ -179,7 +179,7 @@ const SidebarDownload = ({ photo }) => {
let downloadRows = downloads.map(x => (
<DownloadTableRow
key={x.mediaUrl.url}
onClick={() => downloadMedia(x.mediaUrl.url, photo.title)}
onClick={() => downloadMedia(x.mediaUrl.url)}
>
<Table.Cell>{`${x.title}`}</Table.Cell>
<Table.Cell>{`${x.mediaUrl.width} x ${x.mediaUrl.height}`}</Table.Cell>
Expand Down

0 comments on commit d7ed03c

Please sign in to comment.