mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-25 10:05:02 +03:00
fixes public slates for new refresh scheme
This commit is contained in:
parent
059a16845c
commit
58d94d8f6a
@ -11,20 +11,32 @@ export default class ScenePublicSlate extends React.Component {
|
||||
slate: null,
|
||||
};
|
||||
|
||||
componentDidMount = () => {
|
||||
this.renderSlate();
|
||||
componentDidMount = async () => {
|
||||
await this.renderSlate();
|
||||
};
|
||||
|
||||
componentDidUpdate = (prevProps) => {
|
||||
console.log(this.props);
|
||||
console.log(prevProps);
|
||||
if (this.props.data.id !== prevProps.data.id) {
|
||||
this.renderSlate();
|
||||
componentDidUpdate = async (prevProps) => {
|
||||
if (!this.props.data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this.props.data.id === prevProps.data.id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
await this.renderSlate();
|
||||
};
|
||||
|
||||
renderSlate = async () => {
|
||||
for (let slate of this.props.viewer.slates) {
|
||||
if (!this.props.data) {
|
||||
this.props.onAction({
|
||||
type: "NAVIGATE",
|
||||
value: slate.id,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (slate.id === this.props.data.id) {
|
||||
this.props.onAction({
|
||||
type: "NAVIGATE",
|
||||
@ -33,8 +45,8 @@ export default class ScenePublicSlate extends React.Component {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let slate = await Actions.getSerializedSlate({ id: this.props.data.id });
|
||||
console.log(slate);
|
||||
this.setState({ slate: slate.data });
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user