Browse Source

Merge branch 'develop' into fix/5991

Dustin Utecht 3 years ago
parent
commit
6747b9809b
1 changed files with 6 additions and 4 deletions
  1. 6 4
      src/extensions/cookie/bootstrap-table-cookie.js

+ 6 - 4
src/extensions/cookie/bootstrap-table-cookie.js

@@ -481,7 +481,11 @@ $.BootstrapTable = class extends $.BootstrapTable {
 
     if (columnsCookie) {
       for (const column of this.columns) {
-        const filteredColumns = columnsCookie.filter(columnField => {
+        if (!column.switchable) {
+          continue
+        }
+
+        column.visible = columnsCookie.filter(columnField => {
           if (this.isSelectionColumn(column)) {
             return true
           }
@@ -495,9 +499,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
           }
 
           return columnField === column.field
-        })
-
-        column.visible = (filteredColumns.length > 0 || !column.switchable) && column.visible
+        }).length > 0
       }
     }
   }