fix:update open bigfolder app badgenumber

Signed-off-by: wzp <wuzhipeng1@huawei.com>
This commit is contained in:
wzp 2023-12-06 22:03:02 +08:00
parent e5fe9fe131
commit b41ee3b5ae

View File

@ -20,7 +20,8 @@ import {
PresetStyleConstants,
localEventManager,
EventConstants,
CardItemInfo
CardItemInfo,
FolderData
} from '@ohos/common';
import AppItem from './AppItem';
import FormItem from './FormItem';
@ -71,6 +72,19 @@ export default struct SwiperPage {
private updateAppListInfo(): void {
this.mAppListInfo = this.appListInfo.appGridInfo[this.swiperPage];
this.updateOpenFolderData();
}
/**
* 监听桌面元素变化时,更新打开的大文件的数据。
* eg应用角标更新时大文件内的应用角标同步更新。
*/
updateOpenFolderData() {
const openFolderData = AppStorage.get('openFolderData') as FolderData;
if (openFolderData?.folderId && this.mAppListInfo.length) {
let temp = this.mAppListInfo.find((item: LauncherDragItemInfo) => item?.folderId === openFolderData.folderId);
AppStorage.setOrCreate('openFolderData', temp as FolderData);
}
}
aboutToAppear(): void {