Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template lang="pug">
  2. w-app
  3. w-toolbar.w-flex.no-grow.align-start.mb4
  4. .title2 Siimee
  5. .spacer
  6. w-button.ml2 Home
  7. w-button.ml2 Matches
  8. w-button.ml2(@click="openDrawer = true" outline="") Active Chats
  9. .nav(v-if="profile.isLoggedIn" style="display: flex; justify-content: space-between;")
  10. header
  11. h2 current - profile: {{ profile.id }}
  12. w-drawer(v-model="openDrawer")
  13. SideBar(@updatePid="setPid" :pid="profile.id.value")
  14. RouterView(
  15. v-if="profile.isLoggedIn"
  16. :pid="profile.id.value"
  17. @updatePid="setPid"
  18. @show-sidebar="showSidebar = !showSidebar"
  19. )
  20. </template>
  21. <script>
  22. import 'wave-ui/dist/wave-ui.css'
  23. import SideBar from './components/SideBar.vue'
  24. import { currentProfile } from './services'
  25. import { surveyFactory } from './utils'
  26. const DEV_MODE = import.meta.env.VITE_DEV == 'true'
  27. const DEV_PID = 45
  28. export default {
  29. components: { SideBar },
  30. data: () => ({
  31. sliderVal: 1,
  32. openDrawer: false,
  33. }),
  34. computed: {
  35. profile: () => {
  36. return currentProfile
  37. },
  38. },
  39. async created() {
  40. /** Get questions so we can compare against profile responses */
  41. await surveyFactory.getQuestions()
  42. /**
  43. * Development mode turns router guards off so
  44. * we hard set the profile id instead of
  45. * using the login form
  46. */
  47. if (DEV_MODE) {
  48. await this.setPid(DEV_PID)
  49. }
  50. },
  51. methods: {
  52. /**
  53. * Sync up this components state with
  54. * the currentProfile handler
  55. */
  56. async setPid(profileId) {
  57. if (currentProfile.isLoggedIn) {
  58. currentProfile.logout()
  59. }
  60. await currentProfile.login(profileId, this.$waveui.notify)
  61. console.log('---')
  62. },
  63. },
  64. }
  65. </script>