Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2021-06-30 12:56:26 +0300
committerdartcafe <github@dartcafe.de>2021-06-30 12:56:26 +0300
commit4076df1859810af2423fefad8d7077e81d66c86f (patch)
tree9069aaf67c85209cd6d96e555c3a66c3c4b56009 /src/js/store
parent17c7eb26be05a9a327c1ae7acfaa68ad8be78d51 (diff)
make performance threshold configurable
Signed-off-by: dartcafe <github@dartcafe.de>
Diffstat (limited to 'src/js/store')
-rw-r--r--src/js/store/modules/poll.js6
-rw-r--r--src/js/store/modules/settings.js1
2 files changed, 2 insertions, 5 deletions
diff --git a/src/js/store/modules/poll.js b/src/js/store/modules/poll.js
index f932f33d..b4f3a32b 100644
--- a/src/js/store/modules/poll.js
+++ b/src/js/store/modules/poll.js
@@ -27,10 +27,6 @@ import { generateUrl } from '@nextcloud/router'
import acl from './subModules/acl.js'
import { uniqueArrayOfObjects } from '../../helpers/arrayHelper.js'
-// max threshold for cells to display. If the number is too high, rendering
-// of the vote table can become bad, because of too much iterations
-const MAX_CELLS = 200
-
const defaultPoll = () => ({
id: 0,
type: 'datePoll',
@@ -154,7 +150,7 @@ const getters = {
isClosed: (state) => (state.expire > 0 && moment.unix(state.expire).diff() < 1000),
- safeTable: (state, getters) => (getters.countCells > MAX_CELLS),
+ safeTable: (state, getters, rootState) => (getters.countCells > rootState.settings.user.performanceThreshold),
countParticipants: (state, getters) => (getters.participants.length),
diff --git a/src/js/store/modules/settings.js b/src/js/store/modules/settings.js
index bc313fd0..041ded0f 100644
--- a/src/js/store/modules/settings.js
+++ b/src/js/store/modules/settings.js
@@ -34,6 +34,7 @@ const defaultSettings = () => ({
glassySidebar: false,
defaultViewTextPoll: 'list-view',
defaultViewDatePoll: 'table-view',
+ performanceThreshold: 1000,
},
session: {
manualViewDatePoll: '',