Browse Source

fix(sidebarStore): migrate to TS

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
pull/14240/head
Maksim Sukharev 9 months ago
committed by backportbot[bot]
parent
commit
28e989f42a
  1. 2
      src/App.vue
  2. 2
      src/components/CallView/Grid/Grid.vue
  3. 2
      src/components/RightSidebar/Participants/ParticipantsTab.vue
  4. 2
      src/components/RightSidebar/RightSidebar.vue
  5. 2
      src/components/RightSidebar/SharedItems/SharedItemsTab.vue
  6. 2
      src/components/TopBar/TopBar.vue
  7. 2
      src/composables/useViewer.js
  8. 2
      src/main.js
  9. 2
      src/stores/__tests__/sidebar.spec.js
  10. 2
      src/stores/breakoutRooms.ts
  11. 6
      src/stores/sidebar.ts

2
src/App.vue

@ -51,7 +51,7 @@ import { EventBus } from './services/EventBus.ts'
import { leaveConversationSync } from './services/participantsService.js'
import { useCallViewStore } from './stores/callView.js'
import { useFederationStore } from './stores/federation.ts'
import { useSidebarStore } from './stores/sidebar.js'
import { useSidebarStore } from './stores/sidebar.ts'
import { checkBrowser } from './utils/browserCheck.ts'
import { signalingKill } from './utils/webrtc/index.js'

2
src/components/CallView/Grid/Grid.vue

@ -163,7 +163,7 @@ import VideoVue from '../shared/VideoVue.vue'
import { placeholderImage, placeholderModel, placeholderName, placeholderSharedData } from './gridPlaceholders.ts'
import { PARTICIPANT, ATTENDEE } from '../../../constants.js'
import { useCallViewStore } from '../../../stores/callView.js'
import { useSidebarStore } from '../../../stores/sidebar.js'
import { useSidebarStore } from '../../../stores/sidebar.ts'
// Max number of videos per page. `0`, the default value, means no cap
const videosCap = parseInt(loadState('spreed', 'grid_videos_limit'), 10) || 0

2
src/components/RightSidebar/Participants/ParticipantsTab.vue

@ -89,7 +89,7 @@ import { getTalkConfig, hasTalkFeature } from '../../../services/CapabilitiesMan
import { autocompleteQuery } from '../../../services/coreService.ts'
import { EventBus } from '../../../services/EventBus.ts'
import { addParticipant } from '../../../services/participantsService.js'
import { useSidebarStore } from '../../../stores/sidebar.js'
import { useSidebarStore } from '../../../stores/sidebar.ts'
import CancelableRequest from '../../../utils/cancelableRequest.js'
const isFederationEnabled = getTalkConfig('local', 'federation', 'enabled')

2
src/components/RightSidebar/RightSidebar.vue

@ -156,7 +156,7 @@ import SetGuestUsername from '../SetGuestUsername.vue'
import { CONVERSATION, WEBINAR, PARTICIPANT } from '../../constants.js'
import { hasTalkFeature } from '../../services/CapabilitiesManager.ts'
import { useSidebarStore } from '../../stores/sidebar.js'
import { useSidebarStore } from '../../stores/sidebar.ts'
export default {
name: 'RightSidebar',

2
src/components/RightSidebar/SharedItems/SharedItemsTab.vue

@ -101,7 +101,7 @@ import { CONVERSATION } from '../../../constants.js'
import { hasTalkFeature } from '../../../services/CapabilitiesManager.ts'
import { EventBus } from '../../../services/EventBus.ts'
import { useSharedItemsStore } from '../../../stores/sharedItems.js'
import { useSidebarStore } from '../../../stores/sidebar.js'
import { useSidebarStore } from '../../../stores/sidebar.ts'
export default {

2
src/components/TopBar/TopBar.vue

@ -130,7 +130,7 @@ import { useGetParticipants } from '../../composables/useGetParticipants.js'
import { AVATAR, CONVERSATION } from '../../constants.js'
import { getTalkConfig } from '../../services/CapabilitiesManager.ts'
import { useGroupwareStore } from '../../stores/groupware.ts'
import { useSidebarStore } from '../../stores/sidebar.js'
import { useSidebarStore } from '../../stores/sidebar.ts'
import { getStatusMessage } from '../../utils/userStatus.ts'
import { localCallParticipantModel, localMediaModel } from '../../utils/webrtc/index.js'

2
src/composables/useViewer.js

@ -7,7 +7,7 @@ import { nextTick, ref } from 'vue'
import { useIsInCall } from './useIsInCall.js'
import { useCallViewStore } from '../stores/callView.js'
import { useSidebarStore } from '../stores/sidebar.js'
import { useSidebarStore } from '../stores/sidebar.ts'
/**
* @callback OpenViewer

2
src/main.js

@ -18,7 +18,7 @@ import './init.js'
import router from './router/router.js'
import { SettingsAPI } from './services/SettingsAPI.ts'
import store from './store/index.js'
import { useSidebarStore } from './stores/sidebar.js'
import { useSidebarStore } from './stores/sidebar.ts'
// Leaflet icon patch
import 'leaflet/dist/leaflet.css'

2
src/stores/__tests__/sidebar.spec.js

@ -7,7 +7,7 @@ import { setActivePinia, createPinia } from 'pinia'
import { emit } from '@nextcloud/event-bus'
import BrowserStorage from '../../services/BrowserStorage.js'
import { useSidebarStore } from '../sidebar.js'
import { useSidebarStore } from '../sidebar.ts'
jest.mock('@nextcloud/event-bus', () => ({
emit: jest.fn(),

2
src/stores/breakoutRooms.ts

@ -9,7 +9,7 @@ import Vue from 'vue'
import { showError } from '@nextcloud/dialogs'
import { t } from '@nextcloud/l10n'
import { useSidebarStore } from './sidebar.js'
import { useSidebarStore } from './sidebar.ts'
import {
configureBreakoutRooms,
deleteBreakoutRooms,

6
src/stores/sidebar.js → src/stores/sidebar.ts

@ -14,9 +14,9 @@ export const useSidebarStore = defineStore('sidebar', {
}),
actions: {
showSidebar({ activeTab, cache = true } = {}) {
showSidebar({ activeTab = '', cache = true }: { activeTab?: string, cache?: boolean } = {}) {
this.show = true
if (activeTab && typeof activeTab === 'string') {
if (activeTab) {
emit('spreed:select-active-sidebar-tab', activeTab)
}
if (cache) {
@ -24,7 +24,7 @@ export const useSidebarStore = defineStore('sidebar', {
}
},
hideSidebar({ cache = true } = {}) {
hideSidebar({ cache = true }: { cache?: boolean } = {}) {
this.show = false
if (cache) {
BrowserStorage.setItem('sidebarOpen', 'false')
Loading…
Cancel
Save