Skip to content
This repository was archived by the owner on Jul 11, 2019. It is now read-only.

Commit 773c992

Browse files
committedAug 26, 2018
Add loaders and "no sessions" message to sessions-list
1 parent 7267497 commit 773c992

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed
 

‎src/components/session/SessionsList.vue

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
<v-tabs-items>
88
<v-tab-item>
99
<v-card flat>
10+
<v-progress-linear
11+
v-if="isFetchingSessions"
12+
:indeterminate="true"
13+
/>
14+
<div
15+
v-if="!isFetchingSessions && !hasSessions"
16+
class="headline pa-4"
17+
>Nenhuma Sessão! 😯</div>
1018
<v-list two-line subheader>
1119
<v-expansion-panel popout>
1220
<v-expansion-panel-content
@@ -85,20 +93,26 @@ export default {
8593
data: () => ({
8694
sessions: [],
8795
agendas: [],
88-
tab: "current"
96+
tab: "current",
97+
isFetchingSessions: false
8998
}),
9099
computed: {
91100
...mapState(["selectedAssociation"]),
92101
filteredSessions: function() {
93102
return this.sessions.filter(s => s.status === this.statusFilter);
103+
},
104+
hasSessions: function() {
105+
return this.filteredSessions.length !== 0;
94106
}
95107
},
96108
mounted() {
97109
this.addAssociationsSnapListener();
110+
this.isFetchingSessions = true;
98111
},
99112
methods: {
100113
addAssociationsSnapListener() {
101114
sessionsRef(this.selectedAssociation.id).onSnapshot(snapshot => {
115+
this.isFetchingSessions = false
102116
snapshot.docChanges().forEach(async change => {
103117
if (change.type === "added") {
104118
this.sessions.push({
@@ -160,6 +174,3 @@ export default {
160174
}
161175
};
162176
</script>
163-
164-
<style>
165-
</style>

0 commit comments

Comments
 (0)