!370 Fix additional linter errors: #18 Object instead of union and #78 Implicits case to boolean

Merge pull request !370 from Evgeniy Nikeytsev/fix1
This commit is contained in:
openharmony_ci 2023-06-08 02:45:02 +00:00 committed by Gitee
commit 0ee1cf2a66
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 2 additions and 13 deletions

View File

@ -134,7 +134,7 @@ class ScreenManager {
}
let cb;
let i = cbs.length;
while (i--) {
while (i-- != 0) {
cb = cbs[i];
if (cb === fn || cb.fn === fn) {
cbs.splice(i, 1);

View File

@ -162,20 +162,9 @@ struct PhotoBrowser {
if (currentPhoto == undefined) {
return;
}
// Hack with TS type system
let info: object | string = null
if (this.albumInfo != undefined && this.albumInfo != null && this.albumInfo.id != undefined && this.albumInfo.id != null) {
info = this.albumInfo.id
} else {
if (this.albumInfo != undefined && this.albumInfo != null) {
info = this.albumInfo.id
} else {
info = this.albumInfo
}
}
menuContext.withItems([currentPhoto])
.withDeletePageFromType(BroadcastConstants.DELETE_FROM_BROWSER)
.withAlbumId(info as string)
.withAlbumId( Boolean<string>(this.albumInfo.id).valueOf() ? this.albumInfo.id : (Boolean<SimpleAlbumDataItem>(this.albumInfo).valueOf() ? this.albumInfo.toString() : "") )
.withBroadCast(this.broadCast)
.withOperationEndCallback(this.onDeleteEnd.bind(this))
menuOperation = new BatchDeleteMenuOperation(menuContext);