Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(response => {
dispatch({
type: "SET_PHOTOS_HIDDEN_FULFILLED",
payload: {
image_hashes: image_hashes,
hidden: hidden,
updatedPhotos: response.data.updated
}
});
if (hidden) {
var notificationMessage = "were successfully hidden";
} else {
var notificationMessage = "were successfully unhidden";
}
dispatch(
notify({
message: `${response.data.updated.length} photo(s) ` + notificationMessage,
title: "Hide photos",
status: "success",
dismissible: true,
dismissAfter: 3000,
position: "br"
})
);
if (image_hashes.length === 1) {
dispatch(fetchPhotoDetail(image_hashes[0]));
}
})
.catch(err => {
.then(response => {
dispatch(
notify({
message: "Generate Event Albums started",
title: "Generate Event Albums",
status: "success",
dismissible: true,
dismissAfter: 3000,
position: "br"
})
);
dispatch({
type: "GENERATE_EVENT_ALBUMS_FULFILLED",
payload: response.data
});
})
.catch(err => {
.then(response => {
dispatch({
type: "EDIT_USER_ALBUMS_LIST_FULFILLED",
payload: response.data
});
dispatch(
notify({
message: `${
image_hashes.length
} photo(s) were successfully added to existing album "${title}"`,
title: "Add to album",
status: "success",
dismissible: true,
dismissAfter: 3000,
position: "br",
buttons:[{
name:'View Album',
primary:true,
onClick: ()=>{
dispatch(fetchUserAlbum(album_id))
dispatch(push(`/useralbum/${album_id}/`))
}
}]
.then(response => {
dispatch({
type: "DELETE_FACES_FULFILLED",
payload: response.data.results
});
dispatch(
notify({
message: `${
response.data.results.length
} face(s) were successfully deleted`,
title: "Face delete",
status: "success",
dismissible: true,
dismissAfter: 3000,
position: "br"
})
);
})
.catch(err => {
zoneFile
)
if (res.error) {
logger.error(res.error)
let message =
`Sorry, something went wrong while registering ${domainName}. ` +
'You can try to register again later from your profile page. Some ' +
'apps may be unusable until you do.'
if (res.status === 409) {
message =
"Sorry, it looks like we weren't able to process your name registration. Please contact us at support@blockstack.org for help. Some apps may be unusable until you register an ID."
}
dispatch(registrationError(message))
dispatch(
notify({
title: 'Username Registration Failed',
message,
status: 'error',
dismissAfter: 6000,
dismissible: true,
closeButton: true,
position: 'b'
})
)
} else {
logger.debug(`Successfully submitted registration for ${domainName}`)
dispatch(registrationSubmitted())
dispatch(IdentityActions.addUsername(identityIndex, domainName))
}
} catch (e) {
logger.error('registerName: error POSTing registration to registrar', e)