fix: activity url

This commit is contained in:
Akuoko Daniel Jnr 2021-02-22 12:57:04 +00:00
parent 76efdcf1ea
commit 1ebcd04bc0
No known key found for this signature in database
GPG Key ID: 1C95803CACD3E9DC
3 changed files with 11 additions and 4 deletions

View File

@ -44,7 +44,7 @@ export const navigation = [
id: "NAV_ACTIVITY",
decorator: "ACTIVITY",
name: "Activity",
pageTitle: "Welcome back!",
pageTitle: "Activity",
ignore: true,
},
{

View File

@ -185,7 +185,7 @@ export class GlobalCarousel extends React.Component {
visible: true,
index: e.detail.index || 0,
});
if (this.props.carouselType === "SLATE") {
if (this.props.carouselType === "SLATE" || this.props.carouselType === "ACTIVITY") {
const data = this.props.objects[e.detail.index];
this.setWindowState(data.cid);
}
@ -210,7 +210,7 @@ export class GlobalCarousel extends React.Component {
}
this.setState({ index });
if (this.props.carouselType === "SLATE") {
if (this.props.carouselType === "SLATE" || this.props.carouselType === "ACTIVITY") {
const data = this.props.objects[index];
this.setWindowState(data.cid);
}
@ -223,7 +223,7 @@ export class GlobalCarousel extends React.Component {
}
this.setState({ index });
if (this.props.carouselType === "SLATE") {
if (this.props.carouselType === "SLATE" || this.props.carouselType === "ACTIVITY") {
const data = this.props.objects[index];
this.setWindowState(data.cid);
}

View File

@ -271,6 +271,13 @@ export default class SceneActivity extends React.Component {
fetchActivityItems = async (update = false) => {
this.setState({ loading: "loading" });
window.history.replaceState(
{ ...window.history.state },
"Slate",
`/${this.props.viewer.username}/activity`
);
let activity =
this.props.tab === 0 ? this.props.viewer.activity || [] : this.props.viewer.explore || [];
let response;