mirror of
https://github.com/openharmony/applications_notes.git
synced 2026-07-21 00:26:37 -04:00
使用wukong工具进行稳定性测试时出现jscrash
Signed-off-by: gaoxiangzhong <2323004635@qq.com>
This commit is contained in:
@@ -302,16 +302,20 @@ export struct ToolBarComp {
|
|||||||
Image(this.selectedNoteData.is_favorite == Favorite.Yes ? $r('app.media.favorite') : $r('app.media.favorite_cancel'))
|
Image(this.selectedNoteData.is_favorite == Favorite.Yes ? $r('app.media.favorite') : $r('app.media.favorite_cancel'))
|
||||||
.height(24).width(24)
|
.height(24).width(24)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes)
|
try {
|
||||||
// update note to db
|
this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes)
|
||||||
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
|
// update note to db
|
||||||
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
|
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
|
||||||
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
|
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
|
||||||
// save continue data
|
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
|
||||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
// save continue data
|
||||||
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
|
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||||
LogUtil.info(TAG, 'ToolBarComp, set continue note success')
|
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
|
||||||
NoteUtil.refreshAll()
|
LogUtil.info(TAG, 'ToolBarComp, set continue note success')
|
||||||
|
NoteUtil.refreshAll()
|
||||||
|
} catch (error) {
|
||||||
|
LogUtil.error(TAG, 'favorite error: ' + JSON.stringify(error));
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}.width(36)
|
}.width(36)
|
||||||
.visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible)
|
.visibility(this.selectedNoteData.is_deleted == Delete.Yes ? Visibility.None : Visibility.Visible)
|
||||||
|
|||||||
@@ -773,23 +773,27 @@ export struct ToolBarComp {
|
|||||||
.height(24)
|
.height(24)
|
||||||
.width(24)
|
.width(24)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes)
|
try {
|
||||||
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
|
this.selectedNoteData.is_favorite = (this.selectedNoteData.is_favorite == Favorite.Yes ? Favorite.No : Favorite.Yes)
|
||||||
// update note to db
|
this.refreshFlag = (this.refreshFlag == 0 ? 1 : 0)
|
||||||
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
|
// update note to db
|
||||||
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
|
let predicates_note = RdbStoreUtil.getRdbPredicates(TableName.NoteTable)
|
||||||
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
|
predicates_note.equalTo(NoteTableColumn.Uuid, this.selectedNoteData.uuid)
|
||||||
if (this.selectedFolderData.uuid === SysDefFolderUuid.MyFavorites) {
|
RdbStoreUtil.update(this.selectedNoteData.toNoteObject(), predicates_note, null)
|
||||||
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.MyFavorites)
|
if (this.selectedFolderData.uuid === SysDefFolderUuid.MyFavorites) {
|
||||||
this.controllerShow.runJavaScript(
|
this.selectedNoteData = NoteUtil.getFirstNoteData(AppStorage.Get('AllNoteArray'), SysDefFolderUuid.MyFavorites)
|
||||||
"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
|
this.controllerShow.runJavaScript(
|
||||||
)
|
"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
|
||||||
// save continue data
|
)
|
||||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
// save continue data
|
||||||
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
|
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||||
LogUtil.info(TAG, "ToolBarComp, set continue note success")
|
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'))
|
Image($r('app.media.delete'))
|
||||||
.height(24)
|
.height(24)
|
||||||
|
|||||||
Reference in New Issue
Block a user