aboutsummaryrefslogtreecommitdiff
path: root/client/js/models
diff options
context:
space:
mode:
authorShyam Sunder2018-06-25 10:47:20 -0400
committerMarcin Kurczewski2018-06-27 21:20:03 +0200
commit3972b902d840e54bd4f8dd47a9d13bc20ee22c65 (patch)
tree22a2d05fdc2a89a6c6595ef2a56d0747d761dc2a /client/js/models
parent2bf361c64a46d575533f68f8ced88e037f887335 (diff)
client: fetch configurations from server at runtime
Permissions, regex filters, app title, email info, and safety now fetched using server's Info API
Diffstat (limited to 'client/js/models')
-rw-r--r--client/js/models/post_list.js2
-rw-r--r--client/js/models/top_navigation.js8
2 files changed, 6 insertions, 4 deletions
diff --git a/client/js/models/post_list.js b/client/js/models/post_list.js
index 2e3c6fc..2bfd056 100644
--- a/client/js/models/post_list.js
+++ b/client/js/models/post_list.js
@@ -37,7 +37,7 @@ class PostList extends AbstractList {
static _decorateSearchQuery(text) {
const browsingSettings = settings.get();
const disabledSafety = [];
- if (config.enableSafety) {
+ if (api.safetyEnabled()) {
for (let key of Object.keys(browsingSettings.listPosts)) {
if (browsingSettings.listPosts[key] === false) {
disabledSafety.push(key);
diff --git a/client/js/models/top_navigation.js b/client/js/models/top_navigation.js
index ebb3753..a7c726d 100644
--- a/client/js/models/top_navigation.js
+++ b/client/js/models/top_navigation.js
@@ -1,7 +1,7 @@
'use strict';
-const config = require('../config.js');
const events = require('../events.js');
+const api = require('../api.js');
class TopNavigationItem {
constructor(accessKey, title, url, available, imageUrl) {
@@ -53,8 +53,10 @@ class TopNavigation extends events.EventTarget {
}
setTitle(title) {
- document.oldTitle = null;
- document.title = config.name + (title ? (' – ' + title) : '');
+ api.fetchConfig().then(() => {
+ document.oldTitle = null;
+ document.title = api.getName() + (title ? (' – ' + title) : '');
+ });
}
showAll() {

© 2015 - 2026 Jakob L. Kreuze