From ab8a142790f8b1dcd1f771e98a21180cd21a1797 Mon Sep 17 00:00:00 2001 From: Ianyourgod <104151459+Ianyourgod@users.noreply.github.com> Date: Fri, 29 Nov 2024 15:06:10 -0600 Subject: [PATCH] fix project page --- src/lib/tw-project-meta-fetcher-hoc.jsx | 40 +++++++++++++------------ 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/lib/tw-project-meta-fetcher-hoc.jsx b/src/lib/tw-project-meta-fetcher-hoc.jsx index fcbb1339bc6..13c67a76854 100644 --- a/src/lib/tw-project-meta-fetcher-hoc.jsx +++ b/src/lib/tw-project-meta-fetcher-hoc.jsx @@ -103,7 +103,7 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) { this.props.onSetDescription(instructions, credits); } if ( - String(rawData.remix) !== '0' // checks isRemix and remixId existing at the same time + rawData.public === true ) { this.props.onSetExtraProjectInfo( rawData.public, @@ -114,25 +114,27 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) { new Date(rawData.lastUpdate), rawData.lastUpdate !== rawData.date ); - // this is a remix, find the original project - fetchProjectMeta(rawData.remix) - .then(remixProject => { - // If project ID changed, ignore the results. - if (this.props.projectId !== projectId) { - console.log("hi skibward"); - return; - } - this.props.onSetRemixedProjectInfo( - true, // loaded - remixProject.title, - remixProject.author.username - ); - }) - .catch(err => { - // this isnt fatal, just log - log.warn('cannot fetch remixed project meta for this project;', err); - }); + if (String(rawData.remix) !== '0') { + // this is a remix, find the original project + fetchProjectMeta(rawData.remix) + .then(remixProject => { + // If project ID changed, ignore the results. + if (this.props.projectId !== projectId) { + return; + } + + this.props.onSetRemixedProjectInfo( + true, // loaded + remixProject.title, + remixProject.author.username + ); + }) + .catch(err => { + // this isnt fatal, just log + log.warn('cannot fetch remixed project meta for this project;', err); + }); + } } setIndexable(true); })