MCPcopy Create free account
hub / github.com/codecombat/codecombat / sortedContacts

Function sortedContacts

app/views/admin/SkippedContactsView.js:144–159  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

142 Vuex.mapState('page', ['skippedContacts', 'users']),
143 Vuex.mapGetters('page', ['numArchivedUsers']), {
144 sortedContacts (state) {
145 switch (state.sortOrder) {
146 case 'date (ascending)':
147 return _(state.skippedContacts).sortBy(s => s.dateCreated).value()
148 case 'date (descending)':
149 return _(state.skippedContacts).sortBy(s => s.dateCreated).reverse().value()
150 case 'email':
151 return _(state.skippedContacts).sortBy(s => __guard__(s.trialRequest != null ? s.trialRequest.properties : undefined, x => x.email)).value()
152 case 'archived':
153 return _(state.skippedContacts).sortBy(s => !!s.archived).reverse().value()
154 case 'unarchived':
155 return _(state.skippedContacts).sortBy(s => !!s.archived).value()
156 default:
157 return state.skippedContacts
158 }
159 }
160 }
161 ),
162 methods: {

Callers

nothing calls this directly

Calls 1

__guard__Function · 0.70

Tested by

no test coverage detected