Skip to content

Commit 49189c7

Browse files
author
farfromrefug
committed
chore: refactor
1 parent 519eb9e commit 49189c7

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/image/index.android.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -671,14 +671,14 @@ export class Img extends ImageBase {
671671
if (Trace.isEnabled()) {
672672
CLog(CLogTypes.info, 'onFinalImageSet', id, imageInfo, animatable);
673673
}
674-
const nativeView = that?.get();
675-
if (nativeView) {
676-
nativeView.updateViewSize(imageInfo);
677-
nativeView.isLoading = false;
674+
const owner = that?.get();
675+
if (owner) {
676+
owner.updateViewSize(imageInfo);
677+
owner.isLoading = false;
678678
const eventName = ImageBase.finalImageSetEvent;
679-
if (nativeView.hasListeners(eventName)) {
679+
if (owner.hasListeners(eventName)) {
680680
const info = new ImageInfo(imageInfo);
681-
nativeView.notify({
681+
owner.notify({
682682
eventName,
683683
imageInfo: info,
684684
animatable: animatable as AnimatedImage
@@ -690,14 +690,14 @@ export class Img extends ImageBase {
690690
if (Trace.isEnabled()) {
691691
CLog(CLogTypes.info, 'onFailure', id, throwable.getLocalizedMessage());
692692
}
693-
const nativeView = that?.get();
694-
if (nativeView) {
693+
const owner = that?.get();
694+
if (owner) {
695695
// const nView = nativeView.nativeViewProtected;
696-
nativeView.isLoading = false;
696+
owner.isLoading = false;
697697
const eventName = ImageBase.failureEvent;
698-
if (nativeView.hasListeners(eventName)) {
698+
if (owner.hasListeners(eventName)) {
699699
const imageError = new ImageError(throwable);
700-
nativeView.notify({
700+
owner.notify({
701701
eventName,
702702
error: wrapNativeException(throwable)
703703
} as FailureEventData);
@@ -708,11 +708,11 @@ export class Img extends ImageBase {
708708
if (Trace.isEnabled()) {
709709
CLog(CLogTypes.info, 'onIntermediateImageFailed', id, throwable);
710710
}
711-
const nativeView = that?.get();
712-
if (nativeView) {
711+
const owner = that?.get();
712+
if (owner) {
713713
const eventName = ImageBase.intermediateImageFailedEvent;
714-
if (nativeView.hasListeners(eventName)) {
715-
nativeView.notify({
714+
if (owner.hasListeners(eventName)) {
715+
owner.notify({
716716
eventName,
717717
error: wrapNativeException(throwable)
718718
} as FailureEventData);
@@ -723,13 +723,13 @@ export class Img extends ImageBase {
723723
if (Trace.isEnabled()) {
724724
CLog(CLogTypes.info, 'onIntermediateImageSet', id, imageInfo);
725725
}
726-
const nativeView = that?.get();
727-
if (nativeView) {
728-
nativeView.updateViewSize(imageInfo);
726+
const owner = that?.get();
727+
if (owner) {
728+
owner.updateViewSize(imageInfo);
729729
const eventName = ImageBase.intermediateImageSetEvent;
730-
if (nativeView.hasListeners(eventName)) {
730+
if (owner.hasListeners(eventName)) {
731731
const info = new ImageInfo(imageInfo);
732-
nativeView.notify({
732+
owner.notify({
733733
eventName,
734734
imageInfo: info
735735
} as IntermediateEventData);
@@ -740,11 +740,11 @@ export class Img extends ImageBase {
740740
if (Trace.isEnabled()) {
741741
CLog(CLogTypes.info, 'onRelease', id);
742742
}
743-
const nativeView = that?.get();
744-
if (nativeView) {
743+
const owner = that?.get();
744+
if (owner) {
745745
const eventName = ImageBase.releaseEvent;
746-
if (nativeView.hasListeners(eventName)) {
747-
nativeView.notify({
746+
if (owner.hasListeners(eventName)) {
747+
owner.notify({
748748
eventName
749749
} as EventData);
750750
}
@@ -754,10 +754,10 @@ export class Img extends ImageBase {
754754
if (Trace.isEnabled()) {
755755
CLog(CLogTypes.info, 'onSubmit', id, callerContext);
756756
}
757-
const nativeView = that?.get();
757+
const owner = that?.get();
758758
const eventName = ImageBase.submitEvent;
759-
if (nativeView?.hasListeners(eventName)) {
760-
nativeView.notify({
759+
if (owner?.hasListeners(eventName)) {
760+
owner.notify({
761761
eventName
762762
} as EventData);
763763
}

0 commit comments

Comments
 (0)