From 78165b54e4c12e9a04341d505917fd5d3af6ce1e Mon Sep 17 00:00:00 2001 From: Sarah Allen Date: Sat, 20 Feb 2016 09:55:28 -0600 Subject: [PATCH] Project Group fetch-fail. Default props on share component --- app/annotation/summary.cjsx | 8 ++++++-- app/share.cjsx | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/annotation/summary.cjsx b/app/annotation/summary.cjsx index 1237e26..1cea6ca 100644 --- a/app/annotation/summary.cjsx +++ b/app/annotation/summary.cjsx @@ -28,19 +28,23 @@ Summary = React.createClass @setState chimpsSeen: true ProjectGroup.on 'fetch', @onProjectGroupFetch + ProjectGroup.on 'fetch-fail', @onProjectGroupFail ProjectGroup.fetch() componentWillUnmount: -> ProjectGroup.off 'fetch', @onProjectGroupFetch + ProjectGroup.off 'fetch-fail', @onProjectGroupFail onProjectGroupFetch: -> - groupId = Subject.current.group_id group = ProjectGroup.find groupId @setState({ group: group newChimpsLink: group.metadata.new_chimps_link }, => @getSiteLocation()) + onProjectGroupFail: -> + console.error 'Project Group fetch failed' + getSiteLocation: -> locationName = @state.group.metadata.site @@ -77,7 +81,7 @@ Summary = React.createClass {noteSummary} - +
+ zooniverseId: null + video: null + talkHref: -> domain = location.hostname.replace /^www\./, '' "http://talk.#{domain}/#/subjects/#{@props.zooniverseId}"