1
Fork 0

Fix bug where setting share password would print error

This solves #133
This commit is contained in:
viktorstrate 2020-11-17 17:01:29 +01:00
parent 514d9b1c2d
commit d7ed03ca4f
3 changed files with 4 additions and 2 deletions

View File

@ -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),
@ -202,7 +203,7 @@ const TokenRoute = ({ match }) => {
match={match}
refetchWithPassword={password => {
saveSharePassword(token, password)
refetch({ variables: { password } })
refetch({ token, password })
}}
loading={loading}
/>

View File

@ -115,6 +115,7 @@ const ShareItemMoreDropdown = ({ id, share, isPhoto }) => {
event.preventDefault()
setPassword({
variables: {
token: share.token,
password: event.target.value,
},
})

View File

@ -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>