Merge pull request #289 from lava/master

Fix bugs related to custom sticker integration
This commit is contained in:
Travis Ralston 2019-07-09 16:03:06 -06:00 committed by GitHub
commit 4e220bb6af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -2,12 +2,12 @@
<my-spinner></my-spinner>
</div>
<div *ngIf="!isLoading">
<my-ibox boxTitle="Sticker Packs" *ngIf="packs.length <= 0">
<my-ibox boxTitle="Sticker Packs" *ngIf="packs.length <= 0 && !customEnabled">
<div class="my-ibox-content">
<h5 style="text-align: center;">Sticker packs are not enabled on this Dimension instance.</h5>
</div>
</my-ibox>
<my-ibox boxTitle="Add Sticker Packs" *ngIf="packs.length > 0 && customEnabled">
<my-ibox boxTitle="Add Sticker Packs" *ngIf="customEnabled">
<div class="my-ibox-content">
<form (submit)="importPack()" novalidate name="importForm">
<label class="label-block">
@ -42,4 +42,4 @@
</div>
</div>
</my-ibox>
</div>
</div>

View File

@ -92,7 +92,7 @@ export class StickerpickerComponent implements OnInit {
const targetUrl = this.window.location.origin + "/widgets/stickerpicker";
if (widgets.response[0].content.url === targetUrl) {
if (Array.isArray(widgets.response) && widgets.response.length && widgets.response[0].content.url === targetUrl) {
console.warn("Not replacing Dimension sticker picker");
return;
}
@ -113,4 +113,4 @@ export class StickerpickerComponent implements OnInit {
console.error(e);
}
}
}
}