Skip to content

Commit 0cd8a4e

Browse files
committed
fix remix display
1 parent 21e6c1f commit 0cd8a4e

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

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

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -90,54 +90,44 @@ const TWProjectMetaFetcherHOC = function (WrappedComponent) {
9090
if (this.props.projectId !== projectId) {
9191
return;
9292
}
93-
const title = data.name;
93+
const title = data.title;
9494
if (title) {
9595
this.props.onSetProjectTitle(title);
9696
}
9797
const authorName = data.author.username;
9898
const authorThumbnail = `https://projects.penguinmod.com/api/v1/users/getpfp?username=${data.author.username}`;
9999
this.props.onSetAuthor(authorName, authorThumbnail);
100-
const instructions = data.desc || '';
100+
const instructions = data.instructions || '';
101101
const credits = data.notes || '';
102102
if (instructions || credits) {
103103
this.props.onSetDescription(instructions, credits);
104104
}
105105
if (
106-
typeof rawData.accepted === 'boolean'
107-
|| typeof rawData.removedsoft === 'boolean'
108-
|| String(rawData.remix) !== '0' // checks isRemix and remixId existing at the same time
109-
|| typeof rawData.tooLarge === 'boolean'
110-
|| authorName
106+
String(rawData.remix) !== '0' // checks isRemix and remixId existing at the same time
111107
) {
112108
this.props.onSetExtraProjectInfo(
113-
rawData.public && !rawData.softRejected,
109+
rawData.public,
114110
String(rawData.remix) !== '0',
115111
String(rawData.remix),
116112
false,
117113
authorName,
118114
new Date(rawData.lastUpdate),
119115
rawData.lastUpdate !== rawData.date
120116
);
121-
}
122-
if (rawData.remix > 0) {
123117
// this is a remix, find the original project
124118
fetchProjectMeta(rawData.remix)
125119
.then(remixProject => {
126120
// If project ID changed, ignore the results.
127121
if (this.props.projectId !== projectId) {
122+
console.log("hi skibward");
128123
return;
129124
}
130-
// If this project is hidden or not approved, ignore the results.
131-
if (
132-
typeof remixProject.name === 'string'
133-
|| typeof remixProject.owner === 'string'
134-
) {
135-
this.props.onSetRemixedProjectInfo(
136-
true, // loaded
137-
remixProject.name,
138-
remixProject.owner
139-
);
140-
}
125+
126+
this.props.onSetRemixedProjectInfo(
127+
true, // loaded
128+
remixProject.title,
129+
remixProject.author.username
130+
);
141131
})
142132
.catch(err => {
143133
// this isnt fatal, just log

0 commit comments

Comments
 (0)