mirror of
https://gitee.com/openharmony/applications_photos
synced 2024-11-23 07:00:09 +00:00
update product/phone/src/main/ets/view/PhotoBrowserComponent.ets.
Signed-off-by: liujuan <liujuan76@h-partners.com>
This commit is contained in:
parent
6cc88c47c5
commit
9e8b945f04
@ -438,11 +438,11 @@ export struct PhotoBrowserComponent {
|
|||||||
if (currentPhoto == undefined || this.isFromViewDataWithThirdUri) {
|
if (currentPhoto == undefined || this.isFromViewDataWithThirdUri) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.photoDate = DateUtil.getLocalizedDate(currentPhoto.getDataTaken());
|
this.photoDate = DateUtil.getLocalizedDate(currentPhoto?.getDataTaken());
|
||||||
if (this.pageFrom == Constants.ENTRY_FROM.DISTRIBUTED) {
|
if (this.pageFrom == Constants.ENTRY_FROM.DISTRIBUTED) {
|
||||||
this.timeAndLocation = `${this.deviceName}/${DateUtil.getLocalizedTime(currentPhoto.getDataTaken())}`;
|
this.timeAndLocation = `${this.deviceName}/${DateUtil.getLocalizedTime(currentPhoto?.getDataTaken())}`;
|
||||||
} else {
|
} else {
|
||||||
this.timeAndLocation = DateUtil.getLocalizedTime(currentPhoto.getDataTaken());
|
this.timeAndLocation = DateUtil.getLocalizedTime(currentPhoto?.getDataTaken());
|
||||||
}
|
}
|
||||||
this.updateMenu(index);
|
this.updateMenu(index);
|
||||||
}
|
}
|
||||||
@ -561,11 +561,11 @@ export struct PhotoBrowserComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCurrentPhoto(): MediaItem {
|
getCurrentPhoto(): MediaItem {
|
||||||
return this.dataSource.getRawData(this.currentIndex).data;
|
return this.dataSource?.getRawData(this.currentIndex).data;
|
||||||
}
|
}
|
||||||
|
|
||||||
getPhotoByIndex(index: number): MediaItem {
|
getPhotoByIndex(index: number): MediaItem {
|
||||||
return this.dataSource.getRawData(index).data;
|
return this.dataSource?.getRawData(index).data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async onMoveEnd(err: Object, count: number, total: number): Promise<void> {
|
async onMoveEnd(err: Object, count: number, total: number): Promise<void> {
|
||||||
|
Loading…
Reference in New Issue
Block a user