Browse Source

fix(iot-hub): append /preview suffix on card image URL when missing

pull/15787/head
Igor Kulikov 3 months ago
parent
commit
7002697f69
  1. 4
      ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts

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

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

Loading…
Cancel
Save