mirror of
https://gitee.com/openharmony/applications_notes
synced 2024-11-27 01:30:27 +00:00
!256 使用wukong工具进行稳定性测试时出现jscrash
Merge pull request !256 from Gaoxz/master
This commit is contained in:
commit
2b0baebf7c
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user