aboutsummaryrefslogtreecommitdiff
path: root/src/boot/after_store.js
diff options
context:
space:
mode:
authorshpuld <shp@cock.li>2018-12-20 22:20:04 +0200
committershpuld <shp@cock.li>2018-12-20 22:20:04 +0200
commit67263cde05cacd6bf2a8941cce4c562ef88977e4 (patch)
treee2c16bcb643d6286752672ec92db73be7e86bb21 /src/boot/after_store.js
parent640a28789222035f8d500b8dd4bfc4c9f0cdd1af (diff)
parent562c68a51c9746650fabfc5c641816396439c791 (diff)
works but hacky
Diffstat (limited to 'src/boot/after_store.js')
-rw-r--r--src/boot/after_store.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 8cd13df7..5b9e5c96 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -13,12 +13,17 @@ const afterStoreSetup = ({ store, i18n }) => {
store.dispatch('setInstanceOption', { name: 'name', value: name })
store.dispatch('setInstanceOption', { name: 'registrationOpen', value: (registrationClosed === '0') })
store.dispatch('setInstanceOption', { name: 'textlimit', value: parseInt(textlimit) })
- store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadlimit.uploadlimit) })
- store.dispatch('setInstanceOption', { name: 'avatarlimit', value: parseInt(uploadlimit.avatarlimit) })
- store.dispatch('setInstanceOption', { name: 'backgroundlimit', value: parseInt(uploadlimit.backgroundlimit) })
- store.dispatch('setInstanceOption', { name: 'bannerlimit', value: parseInt(uploadlimit.bannerlimit) })
store.dispatch('setInstanceOption', { name: 'server', value: server })
+ // TODO: default values for this stuff, added if to not make it break on
+ // my dev config out of the box.
+ if (uploadlimit) {
+ store.dispatch('setInstanceOption', { name: 'uploadlimit', value: parseInt(uploadlimit.uploadlimit) })
+ store.dispatch('setInstanceOption', { name: 'avatarlimit', value: parseInt(uploadlimit.avatarlimit) })
+ store.dispatch('setInstanceOption', { name: 'backgroundlimit', value: parseInt(uploadlimit.backgroundlimit) })
+ store.dispatch('setInstanceOption', { name: 'bannerlimit', value: parseInt(uploadlimit.bannerlimit) })
+ }
+
if (data.nsfwCensorImage) {
store.dispatch('setInstanceOption', { name: 'nsfwCensorImage', value: data.nsfwCensorImage })
}