Skip to content

Commit 76ebddb

Browse files
committed
fixup! Show full width list for mail
Signed-off-by: greta <[email protected]>
1 parent fd3d5c4 commit 76ebddb

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

src/components/AppSettingsMenu.vue

+12-14
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,18 @@
55
:show-navigation="true"
66
:open.sync="showSettings">
77
<NcAppSettingsSection id="mail-list-view" :name="t('mail', 'Full width view')">
8-
<NcActionRadio value="full-view"
8+
<NcActionRadio value="!getter"
99
:checked="fullView"
10-
@change="showFullWidth('full-view') ">
10+
@change="toggleFullWidthLayout(true) ">
1111
<template #icon>
1212
<CompactMode :size="20" />
1313
</template>
1414
{{ t('mail', 'Show full mode') }}
1515
</NcActionRadio>
1616
{{ viewType }}
17-
<NcActionRadio value="up-bottom"
18-
:checked="viewType === 'up-bottom'"
19-
@change="showFullWidth('up-bottom') ">
20-
<template #icon>
21-
<CompactMode :size="20" />
22-
</template>
23-
{{ t('mail', 'Show Up-Bottom view') }}
24-
</NcActionRadio>
25-
<NcActionRadio value="default-view"
17+
<NcActionRadio value="we need geter true here"
2618
:checked="defaultView"
27-
@change="showFullWidth('default-view') ">
19+
@change="toggleFullWidthLayout('default-view') ">
2820
<template #icon>
2921
<CompactMode :size="20" />
3022
</template>
@@ -239,6 +231,7 @@ import IconLock from 'vue-material-design-icons/Lock.vue'
239231
import Logger from '../logger.js'
240232
import SmimeCertificateModal from './smime/SmimeCertificateModal.vue'
241233
import TrustedSenders from './TrustedSenders.vue'
234+
import { mapGetters } from 'vuex'
242235
243236
export default {
244237
name: 'AppSettingsMenu',
@@ -283,6 +276,9 @@ export default {
283276
}
284277
},
285278
computed: {
279+
...mapGetters({
280+
layoutMode: 'getLayout',
281+
}),
286282
searchPriorityBody() {
287283
return this.$store.getters.getPreference('search-priority-body', 'false') === 'true'
288284
},
@@ -318,8 +314,10 @@ export default {
318314
this.sortOrder = this.$store.getters.getPreference('sort-order', 'newest')
319315
},
320316
methods: {
321-
showFullWidth(value) {
322-
this.viewType = value
317+
toggleFullWidthLayout(value) {
318+
this.$store.dispatch('toggleFullWidthLayoutAction', {
319+
value,
320+
})
323321
},
324322
async onOpen() {
325323
this.showSettings = true

src/store/actions.js

+9
Original file line numberDiff line numberDiff line change
@@ -1499,4 +1499,13 @@ export default {
14991499
},
15001500
})
15011501
},
1502+
async toggleFullWidthLayoutAction({ commit }, value) {
1503+
try {
1504+
commit('toggleFullWidthLayout', {
1505+
value,
1506+
})
1507+
} catch (error) {
1508+
logger.error('Could not switch layout', { error })
1509+
}
1510+
},
15021511
}

src/store/getters.js

+1
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,5 @@ export const getters = {
155155
getInbox: (state, getters) => (accountId) => {
156156
return getters.findMailboxBySpecialRole(accountId, 'inbox')
157157
},
158+
getLayout: (state) => state?.fullWidthLayout,
158159
}

src/store/mutations.js

+3
Original file line numberDiff line numberDiff line change
@@ -506,4 +506,7 @@ export default {
506506
addSmimeCertificate(state, { certificate }) {
507507
state.smimeCertificates = [...state.smimeCertificates, certificate]
508508
},
509+
toggleFullWidthLayout(state, { value }) {
510+
state.fullWidthLayout = value
511+
},
509512
}

0 commit comments

Comments
 (0)