!256 使用wukong工具进行稳定性测试时出现jscrash

Merge pull request !256 from Gaoxz/master
This commit is contained in:
openharmony_ci 2024-04-03 03:53:11 +00:00 committed by Gitee
commit 2b0baebf7c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 34 additions and 26 deletions

View File

@ -302,16 +302,20 @@ export struct ToolBarComp {
Image(this.selectedNoteData.is_favorite == Favorite.Yes ? $r('app.media.favorite') : $r('app.media.favorite_cancel'))
.height(24).width(24)
.onClick(() => {
this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes)
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
// save continue data
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
LogUtil.info(TAG, 'ToolBarComp, set continue note success')
NoteUtil.refreshAll()
try {
this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes)
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
// save continue data
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
LogUtil.info(TAG, 'ToolBarComp, set continue note success')
NoteUtil.refreshAll()
} catch (error) {
LogUtil.error(TAG, 'favorite error: ' + JSON.stringify(error));
}
})
}.width(36)
.visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible)

View File

@ -773,23 +773,27 @@ export struct ToolBarComp {
.height(24)
.width(24)
.onClick(() => {
this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes)
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
if (this.selectedFolderData.uuid === SysDefFolderUuid.MyFavorites) {
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.MyFavorites)
this.controllerShow.runJavaScript(
"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
)
// save continue data
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
LogUtil.info(TAG, "ToolBarComp, set continue note success")
try {
this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes)
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
// update note to db
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
if (this.selectedFolderData.uuid === SysDefFolderUuid.MyFavorites) {
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.MyFavorites)
this.controllerShow.runJavaScript(
"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
)
// save continue data
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
LogUtil.info(TAG, "ToolBarComp, set continue note success")
}
NoteUtil.refreshAll()
} catch (error) {
LogUtil.error(TAG, 'favorite error: ' + JSON.stringify(error));
}
NoteUtil.refreshAll()
})
Image($r('app.media.delete'))
.height(24)