mirror of
https://gitee.com/openharmony/applications_photos
synced 2024-11-23 15:10:25 +00:00
!369 Boolean generics fix
Merge pull request !369 from Maksim Khramov/boolean-generics-fix
This commit is contained in:
commit
4fa9c1a139
@ -136,7 +136,7 @@ class ScreenManager {
|
||||
}
|
||||
}
|
||||
const cbs: CallbackType[] = this.events.get(event);
|
||||
if (!Boolean(cbs).valueOf()) {
|
||||
if (!new Boolean(cbs).valueOf()) {
|
||||
return;
|
||||
}
|
||||
if (fn == null || fn == undefined) {
|
||||
@ -155,7 +155,7 @@ class ScreenManager {
|
||||
|
||||
private emit(event, argument: Object[]): void {
|
||||
let _self = this;
|
||||
if (!Boolean(this.events.get(event)).valueOf()) {
|
||||
if (!new Boolean(this.events.get(event)).valueOf()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -288,10 +288,10 @@ class ScreenManager {
|
||||
this.onLeftBlankChanged(data);
|
||||
let barColor = await getResourceString($r('app.color.default_background_color'));
|
||||
let barContentColor = await getResourceString($r('app.color.default_bar_content_color'));
|
||||
if (!Boolean(barColor).valueOf()) {
|
||||
if (!new Boolean(barColor).valueOf()) {
|
||||
barColor = '#00FFFFFF';
|
||||
}
|
||||
if (!Boolean(barContentColor).valueOf()) {
|
||||
if (!new Boolean(barContentColor).valueOf()) {
|
||||
barContentColor = '#FF000000';
|
||||
}
|
||||
let systemBarProperties: window.SystemBarProperties = {
|
||||
|
@ -20,7 +20,7 @@ const TAG = "SingleInstanceHelper";
|
||||
let globalThis = GlobalContext.getContext();
|
||||
|
||||
export function stashOrGetObject<T>(objectClass: object, storageKey: string): T {
|
||||
if (!Boolean(globalThis.getObject(storageKey)).valueOf()) {
|
||||
if (! new Boolean(globalThis.getObject(storageKey)).valueOf()) {
|
||||
globalThis.setObject(storageKey, objectClass);
|
||||
Log.debug(TAG, "Create key of " + storageKey);
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ export class Save {
|
||||
private static async createFileAsset(item: MediaDataItem, isReplace: Boolean): Promise<MediaLib.FileAsset> | null {
|
||||
let fileAsset = await item.loadFileAsset();
|
||||
|
||||
if (!Boolean(fileAsset).valueOf()) {
|
||||
if (!new Boolean(fileAsset).valueOf()) {
|
||||
Log.warn(TAG, 'get file error');
|
||||
return null;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ struct ThirdSelectAlbumSetPage {
|
||||
if (!Number.isNaN(param.remainingOfWallpapers)) {
|
||||
this.maxSelectCount = new Number(param.remainingOfWallpapers).valueOf()
|
||||
}
|
||||
} else if (Boolean(param.maxSelectCount).valueOf() && param.maxSelectCount > 0) {
|
||||
} else if (new Boolean(param.maxSelectCount).valueOf() && param.maxSelectCount > 0) {
|
||||
let selectCount = new Number(param.maxSelectCount).valueOf();
|
||||
this.maxSelectCount = selectCount > Constants.LIMIT_MAX_THIRD_SELECT_COUNT
|
||||
? Constants.LIMIT_MAX_THIRD_SELECT_COUNT
|
||||
|
@ -131,7 +131,7 @@ struct ThirdSelectPhotoGridPage {
|
||||
this.bundleName = new String(param.bundleName).valueOf();
|
||||
this.isMultiPick = new Boolean(param.isMultiPick).valueOf();
|
||||
this.isFromFa = new Boolean(param.isFromFa).valueOf();
|
||||
if (Boolean(param.maxSelectCount).valueOf() && param.maxSelectCount > 0) {
|
||||
if (new Boolean(param.maxSelectCount).valueOf() && param.maxSelectCount > 0) {
|
||||
this.maxSelectCount = 0;
|
||||
if (!Number.isNaN(param.maxSelectCount)) {
|
||||
this.maxSelectCount = new Number(param.maxSelectCount).valueOf()
|
||||
|
@ -73,9 +73,9 @@ export class TimelinePageBarModel {
|
||||
|
||||
getMenuList(isSelectedMode: boolean, selectedCount: number, isAllSelected: boolean): Action[] {
|
||||
let menuList: Action[] = [];
|
||||
menuList.push(Boolean(selectedCount) ? Action.SHARE : Action.SHARE_INVALID)
|
||||
menuList.push(new Boolean(selectedCount) ? Action.SHARE : Action.SHARE_INVALID)
|
||||
menuList.push(isAllSelected ? Action.DESELECT_ALL : Action.SELECT_ALL)
|
||||
menuList.push(Boolean(selectedCount) ? Action.DELETE : Action.DELETE_INVALID, Action.MORE)
|
||||
menuList.push(new Boolean(selectedCount) ? Action.DELETE : Action.DELETE_INVALID, Action.MORE)
|
||||
return menuList
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user