diff --git a/frontend/app/components/Client/Projects/ProjectCaptureRate.tsx b/frontend/app/components/Client/Projects/ProjectCaptureRate.tsx
index f87536e95..0f0d76938 100644
--- a/frontend/app/components/Client/Projects/ProjectCaptureRate.tsx
+++ b/frontend/app/components/Client/Projects/ProjectCaptureRate.tsx
@@ -40,7 +40,7 @@ function ProjectCaptureRate(props: Props) {
}
}, [projectId]);
- React.useEffect(() => {
+ useEffect(() => {
setConditions(captureConditions.map((condition: any) => new Conditions(condition, true, isMobile)));
}, [captureConditions]);
diff --git a/frontend/app/components/Client/Projects/Projects.tsx b/frontend/app/components/Client/Projects/Projects.tsx
index 89644f354..418963784 100644
--- a/frontend/app/components/Client/Projects/Projects.tsx
+++ b/frontend/app/components/Client/Projects/Projects.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { App, Button, Card, Layout, Space, Typography } from 'antd';
+import { App, Button, Card, Layout, Space, Tooltip, Typography } from 'antd';
import ProjectList from 'Components/Client/Projects/ProjectList';
import ProjectTabs from 'Components/Client/Projects/ProjectTabs';
import { useHistory } from 'react-router-dom';
@@ -52,7 +52,7 @@ function Projects() {
}}
title="Projects"
extra={[
- }>
+ }>
Create Project
]}
@@ -68,8 +68,10 @@ function Projects() {
style={{ height: 46 }}>
{project?.name}
-
+ className="capitalize !m-0 whitespace-nowrap truncate">
+ {project?.name}
+
+
@@ -90,9 +92,7 @@ function Projects() {
export default observer(Projects);
-function ProjectKeyButton() {
- const { projectsStore } = useStore();
- const { project } = projectsStore.config;
+function ProjectKeyButton({ project }: { project: Project | null }) {
const { message } = App.useApp();
const copyKey = () => {
@@ -105,6 +105,8 @@ function ProjectKeyButton() {
};
return (
- } size="small" />
+
+ } size="small" />
+
);
}
diff --git a/frontend/app/components/Client/Projects/TagForm.tsx b/frontend/app/components/Client/Projects/TagForm.tsx
index 4165fc79a..babaf3719 100644
--- a/frontend/app/components/Client/Projects/TagForm.tsx
+++ b/frontend/app/components/Client/Projects/TagForm.tsx
@@ -33,9 +33,13 @@ function TagForm(props: Props) {
const onSave = async () => {
setLoading(true);
- tagWatchStore.updateTagName(tag.tagId, name, projectId).finally(() => {
- setLoading(false);
- });
+ tagWatchStore.updateTagName(tag.tagId, name, projectId)
+ .then(() => {
+ closeModal();
+ })
+ .finally(() => {
+ setLoading(false);
+ });
};
return (
diff --git a/frontend/app/mstore/projectsStore.ts b/frontend/app/mstore/projectsStore.ts
index bc1407912..272ccb1a3 100644
--- a/frontend/app/mstore/projectsStore.ts
+++ b/frontend/app/mstore/projectsStore.ts
@@ -34,6 +34,13 @@ export default class ProjectsStore {
return this.active ? ['ios', 'android'].includes(this.active.platform) : false;
}
+ syncProjectInList = (project: Partial) => {
+ const index = this.list.findIndex(site => site.id === project.id);
+ if (index !== -1) {
+ this.list[index] = this.list[index].edit(project);
+ }
+ }
+
getSiteId = () => {
return {
siteId: this.siteId,
@@ -89,6 +96,15 @@ export default class ProjectsStore {
const gdprData = this.instance.gdpr.toData();
const response = await projectsService.saveGDPR(siteId, gdprData);
this.editGDPR(response.data);
+
+ try {
+ this.syncProjectInList({
+ id: siteId,
+ gdpr: response.data
+ })
+ } catch (error) {
+ console.error('Failed to sync project in list:', error);
+ }
} catch (error) {
console.error('Failed to save GDPR:', error);
}
diff --git a/frontend/app/mstore/settingsStore.ts b/frontend/app/mstore/settingsStore.ts
index fe51173fa..2c84ac202 100644
--- a/frontend/app/mstore/settingsStore.ts
+++ b/frontend/app/mstore/settingsStore.ts
@@ -6,6 +6,7 @@ import Webhook, { IWebhook } from 'Types/webhook';
import { webhookService } from 'App/services';
import { GettingStarted } from './types/gettingStarted';
import { MENU_COLLAPSED } from 'App/constants/storageKeys';
+import { projectStore } from '@/mstore/index';
interface CaptureConditions {
rate: number;
@@ -102,6 +103,15 @@ export default class SettingsStore {
conditionalCapture: data.conditionalCapture,
captureConditions: data.conditions,
});
+
+ try {
+ projectStore.syncProjectInList({
+ id: projectId + '',
+ sampleRate: data.rate,
+ })
+ } catch (e) {
+ console.error('Failed to update project in list:', e);
+ }
toast.success('Settings updated successfully');
})
.catch((err) => {