turt2live / matrix-dimension

An open source integration manager for matrix clients, like Element.
https://dimension.t2bot.io
GNU General Public License v3.0
433 stars 110 forks source link

Cannot add new Sticker Packs unless at least one Pack is already active #288

Closed lava closed 5 years ago

lava commented 5 years ago

When all "default" sticker packs are disabled in the admin panel, clicking on the sticker picker leads to a window with the following error:

Sticker packs are not enabled on this Dimension instance.

As soon as at least one custom sticker pack was added, the default sticker packs can be disabled again, but the user is at risk of accidentally locking himself out again: When he disables all of his sticker packs, he can no longer add new ones since he will be hitting the above error again.

lava commented 5 years ago

This fixed it for me:

diff --git a/web/app/configs/stickerpicker/stickerpicker.component.html b/web/app/configs/stickerpicker/stickerpicker.component.html
index 026036f..3180904 100644
--- a/web/app/configs/stickerpicker/stickerpicker.component.html
+++ b/web/app/configs/stickerpicker/stickerpicker.component.html
@@ -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">
turt2live commented 5 years ago

Fixed by https://github.com/turt2live/matrix-dimension/pull/289