bug fix for all photos images fetch
This commit is contained in:
parent
b5bc6dcab9
commit
65ffe84475
|
@ -11,27 +11,26 @@ async function getAlbumsWithThumbnails() {
|
||||||
return albums;
|
return albums;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function getThumbnailForAlbumName(albumName) {
|
async function getThumbnailForAlbumName(albumName) {
|
||||||
const albumsThumbnail = await CKGallery.getThumbnailForAlbumName(albumName);
|
const albumsThumbnail = await CKGallery.getThumbnailForAlbumName(albumName);
|
||||||
|
|
||||||
return albumsThumbnail;
|
return albumsThumbnail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getPhotosForAlbum(albumName, numberOfPhotos, callback, error) {
|
function getPhotosForAlbum(albumName, numberOfPhotos, callback, error) {
|
||||||
|
|
||||||
let groupType = (albumName === 'All Photos') ? 'SavedPhotos' : 'All';
|
let groupType = (albumName.toLowerCase() === 'all photos') ? 'SavedPhotos' : 'All';
|
||||||
//const photoStream = ['Bursts', 'Recently Added', 'Selfies', 'Recently Added', 'Screenshots', 'My Photo Stream'];
|
|
||||||
//if (_.include(photoStream, albumName)) {
|
|
||||||
// groupType = 'PhotoStream';
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const fetchParams = {
|
const fetchParams = {
|
||||||
first: numberOfPhotos,
|
first: numberOfPhotos,
|
||||||
//groupName: albumName,
|
groupTypes: groupType
|
||||||
groupTypes: groupType,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (albumName.toLowerCase() !== 'all photos') {
|
||||||
|
fetchParams.groupName = albumName;
|
||||||
|
}
|
||||||
|
|
||||||
CameraRoll.getPhotos(fetchParams)
|
CameraRoll.getPhotos(fetchParams)
|
||||||
.then((data) => callback(data), (e) => error(e));
|
.then((data) => callback(data), (e) => error(e));
|
||||||
}
|
}
|
||||||
|
@ -41,4 +40,3 @@ export default {
|
||||||
getThumbnailForAlbumName,
|
getThumbnailForAlbumName,
|
||||||
getPhotosForAlbum
|
getPhotosForAlbum
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue