mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-27 10:52:41 +03:00
hotfix: fixes server crashing conditions
This commit is contained in:
parent
f67c08fbc9
commit
d466927624
@ -31,7 +31,7 @@ export const getById = async ({ id }) => {
|
||||
try {
|
||||
data = {
|
||||
id: user.id,
|
||||
data: { photo: user.data.photo, body: user.data.body },
|
||||
data: { photo: user.data.photo, body: user.data.body ? user.data.body : "" },
|
||||
settings: {
|
||||
deals_auto_approve: user.data.settings_deals_auto_approve,
|
||||
},
|
||||
|
@ -28,7 +28,7 @@ export default class SceneSlate extends React.Component {
|
||||
body: this.props.current.data.body,
|
||||
layouts: this.props.current.data.layouts
|
||||
? this.props.current.data.layouts
|
||||
: generateLayout(this.props.current.data.objects),
|
||||
: { lg: generateLayout(this.props.current.data.objects) },
|
||||
loading: false,
|
||||
};
|
||||
|
||||
@ -219,6 +219,8 @@ export default class SceneSlate extends React.Component {
|
||||
render() {
|
||||
const { slatename, objects, body = "A slate." } = this.state;
|
||||
|
||||
console.log(this.state.layouts);
|
||||
|
||||
return (
|
||||
<ScenePage style={{ padding: `88px 24px 128px 24px` }}>
|
||||
<ScenePageHeader
|
||||
|
@ -106,7 +106,7 @@ app.prepare().then(async () => {
|
||||
viewer,
|
||||
creator: {
|
||||
username: creator.username,
|
||||
data: { photo: creator.data.photo, body: creator.data.body },
|
||||
data: { photo: creator.data.photo, body: creator.data.body ? creator.data.body : "A user on Slate." },
|
||||
slates: JSON.parse(JSON.stringify(slates)),
|
||||
},
|
||||
});
|
||||
@ -145,9 +145,7 @@ app.prepare().then(async () => {
|
||||
}
|
||||
|
||||
return app.render(req, res, "/_/slate", {
|
||||
slate: JSON.parse(
|
||||
JSON.stringify({ ...slate, ownername: req.params.username })
|
||||
),
|
||||
slate: JSON.parse(JSON.stringify({ ...slate, ownername: req.params.username })),
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user