diff --git a/views/head.jsx b/views/head.jsx index 2095189..84740b9 100644 --- a/views/head.jsx +++ b/views/head.jsx @@ -1,12 +1,16 @@ 'use strict'; var React = require('react'); +var Router = require('react-router'); module.exports = React.createClass({ + + mixins: [ Router.State ], render: function() { var image = this.props.shares ? this.props.shares[0].artwork.large : "https://match.audio/images/logo-512.png"; var title = this.props.shares ? this.props.shares[0].artist.name + " by " + this.props.shares[0].name : "Match Audio"; + var shareUrl = "https://match.audio/" + this.getParams().service + "/" + this.getParams().type + "/" + this.getParams().id; return (
@@ -20,7 +24,7 @@ module.exports = React.createClass({ - + diff --git a/views/share.jsx b/views/share.jsx index 97b5f69..60f4bd2 100644 --- a/views/share.jsx +++ b/views/share.jsx @@ -87,15 +87,17 @@ module.exports = React.createClass({ getInitialState: function () { if (this.props.shares && this.props.shares[0].id == this.getParams().id) { return { - name: this.props.shares ? this.props.shares[0].name : "", - artist: this.props.shares ? this.props.shares[0].artist.name : "", - shares: this.props.shares || [] + name: this.props.shares[0].name, + artist: this.props.shares[0].artist.name, + shares: this.props.shares, + shareUrl: "https://match.audio/" + this.getParams().service + "/" + this.getParams().type + "/" + this.getParams().id }; } return { name: "", artist: "", - shares: [] + shares: [], + shareUrl: "" }; }, @@ -110,7 +112,6 @@ module.exports = React.createClass({ this.state.shares.forEach(function(share) { if (typeof share.matched_at === "undefined") { - console.log(share) complete = false; } }); @@ -192,9 +193,9 @@ module.exports = React.createClass({