update product/phone/src/main/ets/pages/index.ets.

Signed-off-by: liujuan <liujuan76@h-partners.com>
This commit is contained in:
liujuan 2024-04-17 07:51:08 +00:00 committed by Gitee
parent 2b8503b94f
commit 8638494462
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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)