Commit 2a4bb663353af0f625171ce58950db0e955f1c42
update localStorage instructions, strip quotes when saving to localStorage
Jolyon committed on 11/17/2017, 8:39:18 AMParent: f07a001dc982815ea0ac680cecb40d4c6d71c9f6
Files changed
README.md | changed |
src/components/Settings.vue | changed |
README.md | ||
---|---|---|
@@ -56,12 +56,16 @@ | ||
56 | 56 … | cat ~/.ssb/private |
57 | 57 … | |
58 | 58 … | # place these in browser storage (until this part is built in the app) |
59 | 59 … | |
60 … | +# On the settings page: | |
61 … | + | |
62 … | +# Copy & paste your keypair from ~.ssb/secret | |
63 … | + | |
60 | 64 … | localStorage.setItem("/.ssb/secret", '{"curve":"ed25519","public":"IZckcDcgB....."}') |
61 | 65 … | |
62 | -localStorage.setItem("browser/.ssb/secret", '{"curve":"ed25519","public":"IZckcDcgB....."}') | |
66 … | +# Paste the websocket address from running in terminal: | |
63 | 67 … | |
68 … | +sbot ws.getAdress | |
69 … | + | |
64 | 70 … | localStorage.setItem("remote", 'ws://localhost:8989~shs:TXKFQ.....=') |
65 | 71 … | ``` |
66 | - | |
67 | -``` |
src/components/Settings.vue | |||
---|---|---|---|
@@ -21,24 +21,27 @@ | |||
21 | 21 … | export default { | |
22 | 22 … | data() { | |
23 | 23 … | return { | |
24 | 24 … | identity: { | |
25 | - key: "/.ssb/secret" | ||
25 … | + key: '/.ssb/secret' | ||
26 | 26 … | }, | |
27 | 27 … | remoteWebsocket: { | |
28 | - key: "remote" | ||
28 … | + key: 'remote' | ||
29 | 29 … | } | |
30 | - }; | ||
30 … | + } | ||
31 | 31 … | }, | |
32 | 32 … | created() { | |
33 | 33 … | this.identity.value = | |
34 | - localStorage["/.ssb/secret"] || "the secret goes here"; | ||
34 … | + localStorage["/.ssb/secret"] || "the secret goes here" | ||
35 | 35 … | this.remoteWebsocket.value = | |
36 | - localStorage["remote"] || "sbot ws.getAddress goes here"; | ||
36 … | + localStorage["remote"] || "sbot ws.getAddress goes here" | ||
37 | 37 … | }, | |
38 | 38 … | methods: { | |
39 | 39 … | updateValue(key, value) { | |
40 | - localStorage[key] = value; | ||
40 … | + if(key === 'remote') { | ||
41 … | + value = value.replace(/['"]+/g, '') | ||
42 … | + } | ||
43 … | + localStorage[key] = value | ||
41 | 44 … | } | |
42 | 45 … | } | |
43 | -}; | ||
46 … | +} | ||
44 | 47 … | </script> |
Built with git-ssb-web