Skip to content

Commit

Permalink
turn off debug mode and remove a bunch of unneeded logging
Browse files Browse the repository at this point in the history
  • Loading branch information
colinmorris committed Mar 8, 2017
1 parent 3bb0285 commit 383fcce
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 13 deletions.
4 changes: 0 additions & 4 deletions src/LyricsEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class LyricsEditor extends Component {
return;
}
if (this.ta.value.length === 0) {
console.log('Got blur event with no text entered.');
if (this.props.verse.isBlank()) {
// Do nothing
return;
Expand All @@ -31,10 +30,7 @@ class LyricsEditor extends Component {
console.error("Tried to edit a song that shouldn't be editable. Bailing.");
return;
}
// TODO: if the new text value is blank, revert to the old text
console.log("Got text edit event");
if (this.ta.value === this.props.verse.raw) {
console.log("Detected that edit had no effect. Not regenerating verse.");
return;
}
var verse = new CustomVerse(this.ta.value);
Expand Down
3 changes: 1 addition & 2 deletions src/SongSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@ class SongSelector extends Component {
static loadSong(cb, canned) {
var r = new XMLHttpRequest();
var url = process.env.PUBLIC_URL + '/canned/' + canned.slug + '.txt';
console.log(`Loading ${url}`);
r.open('GET', url);
r.onload = () => {
var verse = CannedVerse.fromCanned(canned, r.response);
cb(verse);
};
r.onerror = () => { console.log("uh oh"); };
r.onerror = () => { console.error(`uh oh. Failed to fetch ${url}`); };
r.send();
}
render() {
Expand Down
6 changes: 0 additions & 6 deletions src/Songsim.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class Songsim extends Component {
componentWillReceiveProps(nextProps) {
if (this.props.location.pathname === nextProps.location.pathname) {
// Not sure if this is even necessary at this point?
console.log('Ignoring props update');
return;
}
// new songid
Expand Down Expand Up @@ -84,7 +83,6 @@ class Songsim extends Component {
if (props.params.customKey) {
// it's a firebase key
var key = props.params.customKey;
console.log(`Looking up firebase key ${key}`);
this.db.load(key).then( (snapshot) => {
var txt = snapshot.val();
if (txt === null) {
Expand Down Expand Up @@ -137,12 +135,8 @@ class Songsim extends Component {

// TODO: sort of confusingly named at this point
makePermalink = () => {
console.log('Permalinking');
console.assert(this.state.verse.isCustom() && !this.state.verse.key);
var ref = this.db.push(this.state.verse);
console.log(ref);
console.log(`Url = ${ref.toString()}`);
console.log(`key = ${ref.key}`);
this.setState(prevState => ({
verse: new CustomVerse(prevState.verse.raw, ref.key)
}));
Expand Down
2 changes: 1 addition & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {MODE} from './constants.js';
var config = {
alleys: true,
default_mode: MODE.vanilla,
debug: true,
debug: false,
exportSVGEnabled: true,
checkerboard: true,
rect_saturation: 100, // range [0-100]
Expand Down

0 comments on commit 383fcce

Please sign in to comment.