Browse Source

fix preview imgs in the solutions tab

pull/15689/head
dpinkevych 2 months ago
committed by Andrew Shvayka
parent
commit
de794f2a28
  1. 5
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts

5
ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts

@ -61,8 +61,9 @@ export class TbIotHubItemCardComponent {
if (!this.item.image) {
return null;
}
const url = this.item.image.split('?')[0];
const resolved = url.endsWith('/preview') ? this.item.image : `${url}/preview`;
const [path, query] = this.item.image.split('?');
const original = path.endsWith('/preview') ? path.slice(0, -'/preview'.length) : path;
const resolved = query ? `${original}?${query}` : original;
return this.iotHubApiService.resolveResourceUrl(resolved);
}

Loading…
Cancel
Save