Skip to content

Commit

Permalink
chore(store): Remove unused currentSession from vuex store
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Mar 14, 2024
1 parent e61a6da commit cdd50ba
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
7 changes: 1 addition & 6 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

<script>
import Vue, { set } from 'vue'
import { mapActions, mapState } from 'vuex'
import { mapState } from 'vuex'
import { getCurrentUser } from '@nextcloud/auth'
import { loadState } from '@nextcloud/initial-state'
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
Expand Down Expand Up @@ -363,10 +363,6 @@ export default {
this.$providers.forEach(p => p.destroy())
},
methods: {
...mapActions('text', [
'setCurrentSession',
]),
initSession() {
if (!this.hasDocumentParameters) {
this.emit('error', 'No valid file provided')
Expand Down Expand Up @@ -483,7 +479,6 @@ export default {
}
this.lock = this.$syncService.lock
localStorage.setItem('nick', this.currentSession.guestName)
this.setCurrentSession(this.currentSession)
this.$attachmentResolver = new AttachmentResolver({
session: this.currentSession,
user: getCurrentUser(),
Expand Down
9 changes: 0 additions & 9 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import axios from '@nextcloud/axios'

import {
SET_SHOW_AUTHOR_ANNOTATIONS,
SET_CURRENT_SESSION,
SET_VIEW_WIDTH,
SET_HEADINGS,
SET_ATTACHMENT_LIST,
Expand All @@ -42,7 +41,6 @@ Vue.use(Vuex)
export const textModule = {
state: {
showAuthorAnnotations: persistentStorage.getItem('showAuthorAnnotations') === 'true',
currentSession: persistentStorage.getItem('currentSession'),
viewWidth: getClientWidth(),
headings: Object.freeze([]),
attachmentList: [],
Expand All @@ -59,10 +57,6 @@ export const textModule = {
state.showAuthorAnnotations = value
persistentStorage.setItem('showAuthorAnnotations', '' + value)
},
[SET_CURRENT_SESSION](state, value) {
state.currentSession = value
persistentStorage.setItem('currentSession', value)
},
[SET_HEADINGS](state, value) {
if (state.headings.length !== value.length) {
state.headings = Object.freeze(value)
Expand Down Expand Up @@ -90,9 +84,6 @@ export const textModule = {
setShowAuthorAnnotations({ commit }, value) {
commit(SET_SHOW_AUTHOR_ANNOTATIONS, value)
},
setCurrentSession({ commit }, value) {
commit(SET_CURRENT_SESSION, value)
},
setHeadings({ commit }, value) {
commit(SET_HEADINGS, value)
},
Expand Down
1 change: 0 additions & 1 deletion src/store/mutation-types.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export const SET_VIEW_WIDTH = 'SET_VIEW_WIDTH'
export const SET_SHOW_AUTHOR_ANNOTATIONS = 'SET_SHOW_AUTHOR_ANNOTATIONS'
export const SET_CURRENT_SESSION = 'SET_CURRENT_SESSION'
export const SET_HEADINGS = 'SET_HEADINGS'
export const SET_ATTACHMENT_LIST = 'SET_ATTACHMENT_LIST'

0 comments on commit cdd50ba

Please sign in to comment.