Skip to content

Commit 99ac4c0

Browse files
committed
chore: better that way
1 parent 01f930c commit 99ac4c0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/image.android.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,9 +490,10 @@ export class Img extends ImageBase {
490490
private async initImage() {
491491
if (this.nativeViewProtected) {
492492
// this.nativeViewProtected.setImageURI(null);
493-
let src = this.src;
493+
const src = this.src;
494494
if (src instanceof Promise) {
495-
src = await src;
495+
this.src = await src;
496+
return;
496497
}
497498
if (src) {
498499
let drawable: android.graphics.drawable.BitmapDrawable;

src/image.ios.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,10 @@ export class Img extends ImageBase {
359359

360360
private async initImage() {
361361
if (this.nativeViewProtected) {
362-
let src = this.src;
362+
const src = this.src;
363363
if (src instanceof Promise) {
364-
src = await src;
364+
this.src = await src;
365+
return;
365366
}
366367
if (src) {
367368
const animate = this.fadeDuration > 0;

0 commit comments

Comments
 (0)