git ssb

0+

ev / minbase



Commit ea39c986dd24cf5a10156a893292a9c4b5c66ba0

only ask server for config if config doesn't already exist in localStorage

Ev Bogue committed on 5/5/2018, 6:52:14 PM
Parent: a93635d6f2271be30eab8d4cdc8444d0b3914861

Files changed

config.jschanged
config.jsView
@@ -2,16 +2,18 @@
22
33 module.exports = function () {
44 var host = window.location.origin
55
6- http.get(host + '/get-config', function (res) {
7- res.on('data', function (data, remote) {
8- config = data
9- localStorage[host] = config
6 + if (localStorage[host])
7 + var config = JSON.parse(localStorage[host])
8 + else
9 + http.get(host + '/get-config', function (res) {
10 + res.on('data', function (data, remote) {
11 + var config = data
12 + localStorage[host] = config
13 + })
1014 })
11- })
1215
13- var config = JSON.parse(localStorage[host])
1416
1517 config.blobsUrl = host + '/blobs/get/'
1618 config.emojiUrl = host + '/img/emoji/'
1719

Built with git-ssb-web