Skip to content

Commit

Permalink
chore(store): remove unused store
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmcg authored and stavares843 committed Jun 22, 2022
1 parent 42d90f0 commit 4aaa111
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 26 deletions.
3 changes: 0 additions & 3 deletions components/ui/Chat/Scroll/Scroll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ export default Vue.extend({
dark: this.theme === 'dark',
}
},
isMediaOpen() {
return this.$store.state.ui.showMedia
},
},
watch: {
// Once a new message is sent
Expand Down
1 change: 0 additions & 1 deletion store/ui/__snapshots__/state.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ Object {
},
"settingsRoute": "personalize",
"settingsSideBar": true,
"showMedia": false,
"showOlderMessagesInfo": false,
"showPinned": false,
"showSearchResult": false,
Expand Down
1 change: 0 additions & 1 deletion store/ui/actions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ const initialState = {
showSidebar: true,
showSearchResult: false,
showSettings: false,
showMedia: false,
settingsSideBar: true,
settingsRoute: 'personalize',
quickProfile: false,
Expand Down
1 change: 0 additions & 1 deletion store/ui/getters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,6 @@ describe('init', () => {
],
showSearchResult: false,
showSettings: false,
showMedia: false,
settingsSideBar: true,
settingsRoute: 'personalize',
quickProfile: false,
Expand Down
18 changes: 6 additions & 12 deletions store/ui/mutations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2298,7 +2298,6 @@ describe('mutations', () => {
showSidebar: true,
showSearchResult: false,
showSettings: false,
showMedia: false,
settingsSideBar: true,
settingsRoute: 'personalize',
quickProfile: false,
Expand Down Expand Up @@ -2534,11 +2533,7 @@ describe('mutations', () => {
mutations.default.showSidebar(localizedState, true)
expect(localizedState.showSidebar).toBeTruthy()
})
test('showMedia', () => {
const localizedState = { ...initialState }
mutations.default.showMedia(localizedState, true)
expect(localizedState.showMedia).toBeTruthy()
})

test('setContextMenuValues', () => {
const localizedState = { ...initialState }
mutations.default.setContextMenuValues(localizedState, true)
Expand Down Expand Up @@ -3480,7 +3475,6 @@ describe('mutations', () => {
],
showSearchResult: false,
showSettings: false,
showMedia: false,
settingsSideBar: true,
settingsRoute: 'personalize',
quickProfile: false,
Expand Down Expand Up @@ -3623,7 +3617,7 @@ describe('mutations', () => {
notifications: [],
showSearchResult: false,
showSettings: false,
showMedia: false,

settingsSideBar: true,
settingsRoute: 'personalize',
quickProfile: false,
Expand Down Expand Up @@ -3798,7 +3792,7 @@ describe('mutations', () => {
],
showSearchResult: false,
showSettings: false,
showMedia: false,

settingsSideBar: true,
settingsRoute: 'personalize',
quickProfile: false,
Expand Down Expand Up @@ -3950,7 +3944,7 @@ describe('mutations', () => {
],
showSearchResult: false,
showSettings: false,
showMedia: false,

settingsSideBar: true,
settingsRoute: 'personalize',
quickProfile: false,
Expand Down Expand Up @@ -4095,7 +4089,7 @@ describe('mutations', () => {
],
showSearchResult: false,
showSettings: false,
showMedia: false,

settingsSideBar: true,
settingsRoute: 'personalize',
quickProfile: false,
Expand Down Expand Up @@ -4239,7 +4233,7 @@ describe('mutations', () => {
],
showSearchResult: false,
showSettings: false,
showMedia: false,

settingsSideBar: true,
settingsRoute: 'personalize',
quickProfile: false,
Expand Down
3 changes: 0 additions & 3 deletions store/ui/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ export default {
showSidebar(state: UIState, enabled: boolean) {
state.showSidebar = enabled
},
showMedia(state: UIState, show: boolean) {
state.showMedia = show
},
setContextMenuValues(state: UIState, values: any) {
state.contextMenuValues = values
},
Expand Down
1 change: 0 additions & 1 deletion store/ui/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const InitialUIState = (): UIState => ({
notifications: [],
showSearchResult: false,
showSettings: false,
showMedia: false,
settingsSideBar: true,
settingsRoute: SettingsRoutes.PERSONALIZE,
quickProfile: false,
Expand Down
1 change: 0 additions & 1 deletion store/ui/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ export interface UIState {
contextMenuPosition: object
quickProfilePosition: object
showSettings: boolean
showMedia: boolean
settingsSideBar: boolean
settingsRoute: SettingsRoutes
showSidebarUsers: boolean
Expand Down
3 changes: 0 additions & 3 deletions store/webrtc/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,13 @@ const webRTCActions = {
type,
})
}
commit('ui/showMedia', true, { root: true })
dispatch('sounds/playSound', Sounds.CALL, { root: true })
}
call.on('INCOMING_CALL', onCallIncoming)

function onCallOutgoing({ peerId }: { peerId: string }) {
commit('setIncomingCall', undefined)
commit('setActiveCall', { callId, peerId })
commit('ui/showMedia', true, { root: true })
dispatch('sounds/playSound', Sounds.CALL, { root: true })
}
call.on('OUTGOING_CALL', onCallOutgoing)
Expand All @@ -491,7 +489,6 @@ const webRTCActions = {

function onCallHangup() {
commit('updateCreatedAt', 0)
commit('ui/showMedia', false, { root: true })
commit('conversation/setCalling', false, { root: true })
commit('setIncomingCall', undefined)
commit('setActiveCall', undefined)
Expand Down

0 comments on commit 4aaa111

Please sign in to comment.