diff --git a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts b/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts index bdf50acddf..2d9c13d8d7 100644 --- a/ui-ngx/src/app/modules/home/components/iot-hub/iot-hub-item-card.component.ts +++ b/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); }