getters.js 711 B

12345678910111213141516171819202122232425
  1. import { buildURI, buildWsURI } from '../functions'
  2. export default {
  3. isHostConfigured(state) {
  4. return !!(state.hostConfig.ssl !== null && state.hostConfig.host && state.hostConfig.port)
  5. },
  6. getHostURI(state, getters) {
  7. if (getters.isHostConfigured)
  8. return buildURI(state.hostConfig.ssl, state.hostConfig.host, state.hostConfig.port)
  9. },
  10. getHostWsURI(state, getters) {
  11. if (getters.isHostConfigured)
  12. return buildWsURI(state.hostConfig.ssl, state.hostConfig.host, state.hostConfig.port)
  13. },
  14. areScenesLoaded(state) {
  15. return state.scenesList !== null
  16. }
  17. // TODO: Cache scene thumb URI
  18. // areScenesThumbsLoaded(state) {
  19. // return state.scenesList !== null
  20. // }
  21. }