Skip to content

Commit 0a95ced

Browse files
committed
chore: update demo with correct image for android
1 parent a41b29d commit 0a95ced

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/demo-angular/src/plugin-demos/nativescript-view-shot.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, inject, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';
22
import { DemoSharedNativescriptViewShot } from '@demo/shared';
3-
import { ImageSource, Screen, View } from '@nativescript/core';
3+
import { ImageSource, isIOS, Screen, View } from '@nativescript/core';
44
import { renderToImageSource } from '@valor/nativescript-view-shot';
55
import { ViewShotService } from '@valor/nativescript-view-shot/angular';
66

@@ -26,8 +26,9 @@ export class NativescriptViewShotComponent {
2626
width = Screen.mainScreen.widthDIPs;
2727
}
2828
this.loading = true;
29+
const image = await this.webImage$;
2930
// reusing imageSource on iOS sometimes doesn't work, so we create a new one each time
30-
this.webImage2 = new ImageSource((await this.webImage$).ios);
31+
this.webImage2 = isIOS ? new ImageSource((await this.webImage$).ios) : image;
3132
this.loading = false;
3233
this.imgSrc = await this.viewShotService.captureInBackground(template, {
3334
logicalHost: attached ? this.vcRef : undefined,

0 commit comments

Comments
 (0)