update: realtime callback for project name.

This commit is contained in:
Darshan
2025-11-06 19:33:19 +05:30
parent ccfa7c7248
commit 22c10e40bb
5 changed files with 1239 additions and 1107 deletions
+1 -1
View File
@@ -53,7 +53,7 @@
"devDependencies": {
"@eslint/compat": "^1.4.0",
"@eslint/js": "^9.37.0",
"@imagine.dev/web-components": "^0.0.32",
"@imagine.dev/web-components": "^0.0.34",
"@melt-ui/pp": "^0.3.2",
"@melt-ui/svelte": "^0.86.6",
"@playwright/test": "^1.56.0",
+1217 -1100
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -106,7 +106,6 @@ if (!building) {
scopedConsoleClient.setProject('console');
clientConsole.setEndpoint(endpoint).setProject('console');
clientRealtime.setEndpoint(endpoint).setProject('console');
clientProject.setEndpoint(endpoint).setMode('admin');
clientRealtime.setEndpoint(endpoint).setProject('console');
}
+14 -3
View File
@@ -7,16 +7,27 @@
import { onMount } from 'svelte';
import { ensureStudioComponent, initImagine, getWebComponents } from './studio-widget';
import { app } from '$lib/stores/app';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
const { region, projectId }: { region: string; projectId: string } = $props();
onMount(() => {
onMount(async () => {
ensureStudioComponent();
initImagine(region, projectId);
await initImagine(region, projectId);
const { changeTheme, initImagineCallbacks } = await getWebComponents();
if (initImagineCallbacks) {
initImagineCallbacks({
onProjectNameChange: (name) => {
invalidate(Dependencies.PROJECT);
}
});
}
return app.subscribe(async ($app) => {
try {
const { changeTheme } = await getWebComponents();
if (changeTheme) {
changeTheme($app.themeInUse);
}
@@ -26,13 +26,18 @@
projectId: $project.$id,
name
});
await invalidate(Dependencies.PROJECT);
await invalidate(Dependencies.ORGANIZATION);
addNotification({
type: 'success',
message: 'Project name has been updated'
});
trackEvent(Submit.ProjectUpdateName);
await Promise.all([
await invalidate(Dependencies.PROJECT),
await invalidate(Dependencies.ORGANIZATION)
]);
} catch (error) {
addNotification({
type: 'error',