Review: add hasMore() computed value +

Replacing varying conditions for same
  logic with computed value `hasMore`.
This commit is contained in:
Raphael Beer 2020-04-09 23:52:12 +02:00
parent b3f1137006
commit e018e2ead9
No known key found for this signature in database
GPG Key ID: C1AC5E018B25EF11

View File

@ -13,7 +13,7 @@
/>
</div>
<base-button
v-if="allConnectionsCount - connections.length"
v-if="hasMore"
:loading="loading"
class="spacer-x-small"
size="small"
@ -26,7 +26,7 @@
}}
</base-button>
<ds-input
v-if="connections.length > 7"
v-if="!hasMore"
v-focus="true"
:name="`${type}Filter`"
:placeholder="filter"
@ -70,9 +70,11 @@ export default {
connections() {
return this.user[this.type]
},
hasMore() {
return this.allConnectionsCount > this.connections.length
},
connectionsClass() {
const overflow = this.connections.length > 7 ? ' --overflow' : ''
return `connections${overflow}`
return `connections${this.hasMore ? '' : ' --overflow'}`
},
filteredConnections() {
if (!this.filter) {