mirror of
https://gitee.com/openharmony/applications_photos
synced 2024-11-23 07:00:09 +00:00
update product/phone/src/main/ets/pages/index.ets.
Signed-off-by: liujuan <liujuan76@h-partners.com>
This commit is contained in:
parent
2b8503b94f
commit
8638494462
@ -130,12 +130,13 @@ struct IndexPage {
|
||||
initPhotosStore() {
|
||||
this.photosPreferences = AppStorage.get<Preferences>(Constants.PHOTOS_STORE_KEY) as Preferences;
|
||||
if (this.photosPreferences) {
|
||||
this.photosPreferences.get('lastPage', 0).then((data: data_preferences.ValueType) => {
|
||||
try {
|
||||
const data: data_preferences.ValueType = this.photosPreferences.getSync('lastPage', 0)
|
||||
this.preIndex = data as number;
|
||||
this.currentIndex = this.preIndex;
|
||||
}).catch((err: Error) => {
|
||||
} catch (err) {
|
||||
this.updatePhotosStore('lastPage', 0);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
Log.info(TAG, 'photosPreferences is undefined');
|
||||
}
|
||||
@ -291,7 +292,6 @@ struct IndexPage {
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.visibility(this.currentIndex === Constants.TIMELINE_PAGE_INDEX ? Visibility.Visible : Visibility.Hidden)
|
||||
}
|
||||
|
||||
TabContent() {
|
||||
@ -302,7 +302,6 @@ struct IndexPage {
|
||||
isShowSelectPhotoBrowser: $isShowSelectPhotoBrowser,
|
||||
pageStatus: this.pageStatus
|
||||
})
|
||||
.visibility(this.currentIndex === Constants.ALBUM_PAGE_INDEX ? Visibility.Visible : Visibility.Hidden)
|
||||
}
|
||||
}
|
||||
.animationDuration(Constants.NUMBER_0)
|
||||
|
Loading…
Reference in New Issue
Block a user