mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-29 16:54:09 +03:00
hot fix for undefined id and unused file stuff in sceneprofile
This commit is contained in:
parent
c7a06dd70d
commit
9a836d3bdf
@ -62,13 +62,11 @@ export const getIdFromCookieValue = (token) => {
|
|||||||
if (!Strings.isEmpty(token)) {
|
if (!Strings.isEmpty(token)) {
|
||||||
try {
|
try {
|
||||||
const decoded = JWT.verify(token, Environment.JWT_SECRET);
|
const decoded = JWT.verify(token, Environment.JWT_SECRET);
|
||||||
id = decoded.id;
|
return decoded.id;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Logging.error(e.message);
|
Logging.error(e.message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return id;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getIdFromCookie = (req) => {
|
export const getIdFromCookie = (req) => {
|
||||||
|
@ -152,16 +152,8 @@ export default class SceneProfile extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
let name = user.name || `@${user.username}`;
|
let name = user.name || `@${user.username}`;
|
||||||
let description, title, file, image;
|
let description, title;
|
||||||
if (this.props.page.params?.cid) {
|
const image = user.photo;
|
||||||
file = user.library.find((file) => file.cid === this.props.page.params.cid);
|
|
||||||
}
|
|
||||||
if (file) {
|
|
||||||
title = `${file.name || file.filename}`;
|
|
||||||
description = file.body ? file.body : `View ${title}, a file from ${name} on Slate`;
|
|
||||||
image = Utilities.getImageUrlIfExists(file, Constants.linkPreviewSizeLimit);
|
|
||||||
} else {
|
|
||||||
image = user.photo;
|
|
||||||
if (user.body) {
|
if (user.body) {
|
||||||
description = `${name}. ${user.body}`;
|
description = `${name}. ${user.body}`;
|
||||||
} else {
|
} else {
|
||||||
@ -172,7 +164,6 @@ export default class SceneProfile extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
title = `${user.username} • Slate`;
|
title = `${user.username} • Slate`;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WebsitePrototypeWrapper
|
<WebsitePrototypeWrapper
|
||||||
|
Loading…
Reference in New Issue
Block a user