📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
fix bug with reload page
kruzhambus9bb7a0bbb956
diff --git a/src/pages/Project/View/ViewProject.container.jsx b/src/pages/Project/View/ViewProject.container.jsxindex 597b5715b..c94e11096 100644--- a/src/pages/Project/View/ViewProject.container.jsx+++ b/src/pages/Project/View/ViewProject.container.jsx@@ -1,19 +1,35 @@import { connect } from 'react-redux'import { errorsActions } from 'redux/actions/errors'import UIActions from 'redux/actions/ui'+import { tabForSharedProject } from 'redux/constants'import ViewProject from './ViewProject'-const mapStateToProps = (state) => ({- projects: state.ui.projects.projects,- sharedProjects: state.ui.projects.sharedProjects,- isLoading: state.ui.projects.isLoading,- cache: state.ui.cache.analytics,- projectViewPrefs: state.ui.cache.projectViewPrefs,- authenticated: state.auth.authenticated,- timezone: state.auth.user.timezone,- user: state.auth.user,-})+const mapStateToProps = (state) => {+ if (state.ui.projects.dashboardTabs === tabForSharedProject) {+ return {+ projects: state.ui.projects.projects,+ sharedProjects: state.ui.projects.sharedProjects,+ isLoading: state.ui.projects.isLoadingShared,+ cache: state.ui.cache.analytics,+ projectViewPrefs: state.ui.cache.projectViewPrefs,+ authenticated: state.auth.authenticated,+ timezone: state.auth.user.timezone,+ user: state.auth.user,+ }+ }++ return {+ projects: state.ui.projects.projects,+ sharedProjects: state.ui.projects.sharedProjects,+ isLoading: state.ui.projects.isLoading,+ cache: state.ui.cache.analytics,+ projectViewPrefs: state.ui.cache.projectViewPrefs,+ authenticated: state.auth.authenticated,+ timezone: state.auth.user.timezone,+ user: state.auth.user,+ }+}const mapDispatchToProps = (dispatch) => ({showError: (message) => {diff --git a/src/redux/actions/ui/index.js b/src/redux/actions/ui/index.jsindex c817495ca..8a6edd049 100644--- a/src/redux/actions/ui/index.js+++ b/src/redux/actions/ui/index.js@@ -85,10 +85,11 @@ const setProjectsError = (error) => ({},})-const setProjectsLoading = (isLoading) => ({+const setProjectsLoading = (isLoading, shared) => ({type: types.SET_PROJECTS_LOADING,payload: {isLoading,+ shared,},})diff --git a/src/redux/reducers/ui/projects.js b/src/redux/reducers/ui/projects.jsindex 29ab41a36..e56776df8 100644--- a/src/redux/reducers/ui/projects.js+++ b/src/redux/reducers/ui/projects.js@@ -9,6 +9,7 @@ const getInitialState = () => {projects: [],sharedProjects: [],isLoading: true,+ isLoadingShared: true,error: null,totalMonthlyEvents: null,total: 0,@@ -26,6 +27,7 @@ const projectsReducer = (state = getInitialState(), { type, payload }) => {if (shared) {return {...state,+ isLoadingShared: false,sharedProjects: projects,}}@@ -221,7 +223,13 @@ const projectsReducer = (state = getInitialState(), { type, payload }) => {}case types.SET_PROJECTS_LOADING: {- const { isLoading } = payload+ const { isLoading, shared = false } = payload+ if (shared) {+ return {+ ...state,+ isLoadingShared: isLoading,+ }+ }return {...state,isLoading,diff --git a/src/redux/sagas/ui/load_shared_projects.js b/src/redux/sagas/ui/load_shared_projects.jsindex 13b88f101..752adbdc8 100644--- a/src/redux/sagas/ui/load_shared_projects.js+++ b/src/redux/sagas/ui/load_shared_projects.js@@ -14,6 +14,8 @@ const debug = Debug('swetrix:rx:s:load-projects')export default function* loadSharedProjects({ payload: { take = ENTRIES_PER_PAGE_DASHBOARD, skip = 0 } }) {try {+ yield put(UIActions.setProjectsLoading(true, true))+let {// eslint-disable-next-line prefer-constresults, totalMonthlyEvents, total,