mirror of
https://gitee.com/openharmony/applications_launcher
synced 2025-02-11 02:36:57 +00:00
bugfix
Signed-off-by: zhangchao <zhangchao338@huawei.com>
This commit is contained in:
parent
f05e308a32
commit
a14dfb4466
@ -55,11 +55,13 @@ class AmsMissionManager {
|
||||
let missionInfos = new Array<OriginMissionInfo>();
|
||||
await missionManager.getMissionInfos('', AmsMissionManager.RECENT_MISSIONS_LIMIT_NUM)
|
||||
.then((res) => {
|
||||
Log.showInfo(TAG, `getRecentMissionsList res.length: ${res.length}`);
|
||||
missionInfos = res;
|
||||
if (!CheckEmptyUtils.isEmptyArr(res)) {
|
||||
Log.showInfo(TAG, `getOriginRecentMissionsList res.length: ${res.length}`);
|
||||
missionInfos = res;
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
Log.showError(TAG, `getRecentMissionsList error: ${JSON.stringify(err)}`);
|
||||
Log.showError(TAG, `getOriginRecentMissionsList error: ${JSON.stringify(err)}`);
|
||||
});
|
||||
return missionInfos;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ export class RecentMissionsViewModel {
|
||||
this.mRecentMissionsList = await amsMissionManager.getRecentMissionsList();
|
||||
} else {
|
||||
this.mRecentMissionsList = [];
|
||||
AppStorage.SetOrCreate('recentMissionsList', this.mRecentMissionsList);
|
||||
AppStorage.SetOrCreate('recentMissionsList', []);
|
||||
await this.deleteRecentMissions();
|
||||
return;
|
||||
}
|
||||
|
@ -166,8 +166,9 @@ struct EntryView {
|
||||
}
|
||||
})
|
||||
}
|
||||
.onAreaChange((event) => {
|
||||
.onAreaChange((oldValue: Area, newValue: Area) => {
|
||||
Log.showDebug(TAG, `onAreaChange navigationBarStatus: ${this.navigationBarStatus}`);
|
||||
if (JSON.stringify(oldValue) == JSON.stringify(newValue)) return;
|
||||
if (this.navigationBarStatus == "1") {
|
||||
setTimeout(() => {
|
||||
SettingsModel.getInstance().setValue(this.navigationBarStatus);
|
||||
|
@ -34,7 +34,7 @@ struct RecentView {
|
||||
private mRecentMissionsViewModel: RecentMissionsViewModel;
|
||||
|
||||
onPageShow(): void {
|
||||
Log.showInfo(TAG, `onPageShow recentMissionsList.length: ${this.recentMissionsList.length}`);
|
||||
Log.showInfo(TAG, 'onPageShow');
|
||||
this.isClickSubComponent = false;
|
||||
this.mRecentMissionsStage.onCreate();
|
||||
this.mRecentMissionsViewModel = RecentMissionsViewModel.getInstance();
|
||||
@ -56,13 +56,16 @@ struct RecentView {
|
||||
|
||||
private closeRecentDockPopup() {
|
||||
let num: number = AppStorage.Get('sysUiRecentOnClickEvent');
|
||||
if (!num) {
|
||||
num = 0;
|
||||
}
|
||||
AppStorage.SetOrCreate('sysUiRecentOnClickEvent', ++num);
|
||||
Log.showInfo(TAG, `aboutToAppear sysUiRecentOnClickEvent closeRecentDockPopup num: ${num}`);
|
||||
}
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
if (this.recentMissionsList.length === 0) {
|
||||
if (!Array.isArray(this.recentMissionsList) || this.recentMissionsList.length == 0) {
|
||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||
Text($r('app.string.No_running_apps_recently'))
|
||||
.fontColor(RecentsStyleConstants.DEFAULT_FONT_COLOR)
|
||||
|
@ -137,8 +137,9 @@ struct EntryView {
|
||||
Column() {
|
||||
SmartDock();
|
||||
}
|
||||
.onAreaChange((event) => {
|
||||
.onAreaChange((oldValue: Area, newValue: Area) => {
|
||||
Log.showDebug(TAG, `onAreaChange navigationBarStatus: ${this.navigationBarStatus}`);
|
||||
if (JSON.stringify(oldValue) == JSON.stringify(newValue)) return;
|
||||
if (this.navigationBarStatus == "1") {
|
||||
setTimeout(() => {
|
||||
SettingsModel.getInstance().setValue(this.navigationBarStatus);
|
||||
|
@ -34,7 +34,7 @@ struct RecentView {
|
||||
private mRecentMissionsViewModel: RecentMissionsViewModel;
|
||||
|
||||
onPageShow(): void {
|
||||
Log.showInfo(TAG, `onPageShow recentMissionsList.length: ${this.recentMissionsList.length}`);
|
||||
Log.showInfo(TAG, 'onPageShow');
|
||||
this.isClickSubComponent = false;
|
||||
this.mRecentMissionsStage.onCreate();
|
||||
this.mRecentMissionsViewModel = RecentMissionsViewModel.getInstance();
|
||||
@ -56,7 +56,7 @@ struct RecentView {
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
if (this.recentMissionsList.length === 0) {
|
||||
if (!Array.isArray(this.recentMissionsList) || this.recentMissionsList.length == 0) {
|
||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||
Text($r('app.string.No_running_apps_recently'))
|
||||
.fontColor(RecentsStyleConstants.DEFAULT_FONT_COLOR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user