You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by am...@apache.org on 2019/10/11 13:17:40 UTC

[couchdb-fauxton] branch master updated: Fix: error when listing db sizes with couchdb v1 (#1236)

This is an automated email from the ASF dual-hosted git repository.

amaranhao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb-fauxton.git


The following commit(s) were added to refs/heads/master by this push:
     new 2eb2e46  Fix: error when listing db sizes with couchdb v1 (#1236)
2eb2e46 is described below

commit 2eb2e46f3cea8a29ef9a1a8399ed09d4c32050b9
Author: Andreas Lappe <nd...@off-pist.de>
AuthorDate: Fri Oct 11 15:17:35 2019 +0200

    Fix: error when listing db sizes with couchdb v1 (#1236)
    
    First try to use the new 'sizes.active' field in CouchDB v2 and fallback to 'data_size' if it doesn't exist.
    
    Fixes #1235
---
 app/addons/databases/stores.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/addons/databases/stores.js b/app/addons/databases/stores.js
index b3e05bc..ce2a383 100644
--- a/app/addons/databases/stores.js
+++ b/app/addons/databases/stores.js
@@ -113,7 +113,7 @@ const DatabasesStoreConstructor = FauxtonAPI.Store.extend({
       return {};
     }
     const {sizes} = details;
-    const dataSize = sizes.active || 0;
+    const dataSize = (sizes && sizes.active) || details.data_size || 0;
 
     return {
       dataSize: Helpers.formatSize(dataSize),