Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Only show treasury if there are balances
Alexis Sellier committed 4 years ago
commit 7398fa1e870e74c8839b7f908f69c08c8e23118b
parent 1561d2b96924d4788b13b97cae20641a44b458f7
1 file changed +8 -3
modified src/base/orgs/View.svelte
@@ -51,8 +51,13 @@
      try {
        const tokens = await utils.getTokens(org.owner, config);
        const balance = await config.provider.getBalance(org.owner);
-
        // To maintain the format we hardcode the ETH specs.
-
        return [{ balance, decimals: 18, logo: "", name: "Ethereum", symbol: "ETH" }, ...tokens];
+

+
        if (! balance.isZero()) {
+
          // To maintain the format we hardcode the ETH specs.
+
          return [{ balance, decimals: 18, logo: "", name: "Ethereum", symbol: "ETH" }, ...tokens];
+
        } else {
+
          return tokens;
+
        }
      } catch (e) {
        console.error(e);
      }
@@ -222,7 +227,7 @@
            {/if}
          </div>
          {#await getOrgTreasury(org) then tokens}
-
            {#if tokens}
+
            {#if tokens && tokens.length > 0}
              <div class="label">Treasury</div>
              <div>
                {#each tokens as token}