Skip to content

Commit ab8a142

Browse files
committed
fix project page
1 parent 4b1797c commit ab8a142

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

src/lib/tw-project-meta-fetcher-hoc.jsx

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
103103
this.props.onSetDescription(instructions, credits);
104104
}
105105
if (
106-
String(rawData.remix) !== '0' // checks isRemix and remixId existing at the same time
106+
rawData.public === true
107107
) {
108108
this.props.onSetExtraProjectInfo(
109109
rawData.public,
@@ -114,25 +114,27 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
114114
new Date(rawData.lastUpdate),
115115
rawData.lastUpdate !== rawData.date
116116
);
117-
// this is a remix, find the original project
118-
fetchProjectMeta(rawData.remix)
119-
.then(remixProject => {
120-
// If project ID changed, ignore the results.
121-
if (this.props.projectId !== projectId) {
122-
console.log("hi skibward");
123-
return;
124-
}
125117

126-
this.props.onSetRemixedProjectInfo(
127-
true, // loaded
128-
remixProject.title,
129-
remixProject.author.username
130-
);
131-
})
132-
.catch(err => {
133-
// this isnt fatal, just log
134-
log.warn('cannot fetch remixed project meta for this project;', err);
135-
});
118+
if (String(rawData.remix) !== '0') {
119+
// this is a remix, find the original project
120+
fetchProjectMeta(rawData.remix)
121+
.then(remixProject => {
122+
// If project ID changed, ignore the results.
123+
if (this.props.projectId !== projectId) {
124+
return;
125+
}
126+
127+
this.props.onSetRemixedProjectInfo(
128+
true, // loaded
129+
remixProject.title,
130+
remixProject.author.username
131+
);
132+
})
133+
.catch(err => {
134+
// this isnt fatal, just log
135+
log.warn('cannot fetch remixed project meta for this project;', err);
136+
});
137+
}
136138
}
137139
setIndexable(true);
138140
})

0 commit comments

Comments
 (0)