Skip to content

Commit ef61f15

Browse files
committed
Some code cleanup.
1 parent 733bb05 commit ef61f15

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

js/editor.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
const { h, render, Component } = preact;
22
const { route, Router, Link } = preactRouter;
33

4-
const BASE_REST_URL = 'https://emrg-pcg.firebaseio.com/';
5-
const SKETCH_REST_URL = 'https://emrg-pcg.firebaseio.com/sketch/';
4+
const BASE_REST_URL = config.databaseURL;
5+
const SKETCH_REST_URL = BASE_REST_URL + '/sketch/';
66

77
function debounce(func, wait) {
88
let timeout;
@@ -33,7 +33,7 @@ gMarkedRenderer.code = function(code, lang) {
3333
if (lang === 'seed') {
3434
html = `<div class="code-wrap">${ html }<div class="code-result"></div></div>`;
3535
}
36-
return htmsketch ===l;
36+
return html;
3737
}
3838

3939
const INITIAL_TEXT = `root:
@@ -142,11 +142,11 @@ class Home extends Component {
142142
}
143143
}
144144

145-
async function loadSketch(url){
146-
let getRequest = new Request(SKETCH_REST_URL+url+'.json');
147-
const res = await fetch(getRequest,{method:'GET'});
148-
const json = await res.json();
149-
return json;
145+
async function loadSketch(url) {
146+
let getRequest = new Request(`${SKETCH_REST_URL}${url}.json`);
147+
const res = await fetch(getRequest, { method: 'GET' });
148+
const json = await res.json();
149+
return json;
150150
}
151151

152152
class Source extends Component {

0 commit comments

Comments
 (0)