From eca93af6b78f52a3b35a6665004b85d2c454397b Mon Sep 17 00:00:00 2001 From: chenzhang Date: Wed, 16 Apr 2025 03:10:06 +0000 Subject: [PATCH] =?UTF-8?q?update=20product/phone/src/main/ets/view/PhotoB?= =?UTF-8?q?rowserComponent.ets.=20[Bug]:=20=E3=80=90OpenHarmony=205.0.2.12?= =?UTF-8?q?6=E3=80=91=E3=80=90RK3568=E3=80=91=E3=80=90=E5=8E=8B=E5=8A=9B?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E3=80=91=E3=80=90ToC=E3=80=91=E3=80=90?= =?UTF-8?q?=E4=BD=8E=E6=A6=82=E7=8E=871/100=E3=80=91=E3=80=90wukong?= =?UTF-8?q?=E3=80=91=E5=87=BA=E7=8E=B01=E6=AC=A1=20=E8=BF=9B=E7=A8=8Bcom.o?= =?UTF-8?q?hos.photos=E5=87=BA=E7=8E=B0jscrash,=E6=A0=88=E5=90=8D=EF=BC=9A?= =?UTF-8?q?onPhotoChanged=20https://gitee.com/openharmony/applications=5Fp?= =?UTF-8?q?hotos/issues/IBMI62?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenzhang --- product/phone/src/main/ets/view/PhotoBrowserComponent.ets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product/phone/src/main/ets/view/PhotoBrowserComponent.ets b/product/phone/src/main/ets/view/PhotoBrowserComponent.ets index e0f104de..1f63a7b8 100644 --- a/product/phone/src/main/ets/view/PhotoBrowserComponent.ets +++ b/product/phone/src/main/ets/view/PhotoBrowserComponent.ets @@ -399,9 +399,9 @@ export struct PhotoBrowserComponent { if (!currentPhoto) { Log.error(TAG, 'onPhotoChanged, item is undefined'); } else { - const timelineIndex: number = this.dataSource.getPositionByIndex(index) ?? Number.NaN; + const timelineIndex: number = this.dataSource.getPositionByIndex?.(index) ?? Number.NaN; AppStorage.setOrCreate('placeholderIndex', timelineIndex); - this.geometryTransitionId = this.browserController.pageFrom + currentPhoto.getHashCode() + 'false'; + this.geometryTransitionId = this.browserController.pageFrom + currentPhoto.getHashCode?.() + 'false'; AppStorage.setOrCreate('geometryTransitionBrowserId', this.geometryTransitionId); Log.debug(TAG, `onPhotoChanged, index: ${index}, currentPhoto: ${currentPhoto.uri}, \ placeholderIndex ${AppStorage.get('placeholderIndex') as number},\ -- Gitee