Share object expiry value modification modal was not working (#3860)

This commit is contained in:
Krishna Srinivas
2017-03-06 18:50:25 -08:00
committed by Harshavardhana
parent 966818955e
commit 436db49bf3
3 changed files with 34 additions and 40 deletions

View File

@@ -80,11 +80,12 @@ export const hideDeleteConfirmation = () => {
}
}
export const showShareObject = url => {
export const showShareObject = (object, url) => {
return {
type: SET_SHARE_OBJECT,
shareObject: {
url: url,
object,
url,
show: true
}
}
@@ -106,9 +107,10 @@ export const shareObject = (object, expiry) => (dispatch, getState) => {
let bucket = currentBucket
if (!web.LoggedIn()) {
dispatch(showShareObject(`${host}/${bucket}/${object}`))
dispatch(showShareObject(object, `${host}/${bucket}/${object}`))
return
}
web.PresignedGet({
host,
bucket,
@@ -116,7 +118,11 @@ export const shareObject = (object, expiry) => (dispatch, getState) => {
expiry
})
.then(obj => {
dispatch(showShareObject(obj.url))
dispatch(showShareObject(object, obj.url))
dispatch(showAlert({
type: 'success',
message: `Object shared, expires in ${expiry} seconds`
}))
})
.catch(err => {
dispatch(showAlert({
@@ -604,4 +610,4 @@ export const checkedObjectsReset = (objectName) => {
type: CHECKED_OBJECTS_RESET,
objectName
}
}
}