mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
update: logic as per the component updates.
This commit is contained in:
@@ -270,7 +270,11 @@ export function hideStudio() {
|
||||
restoreBodyScroll();
|
||||
}
|
||||
|
||||
export async function initImagine(region: string, projectId: string) {
|
||||
export async function initImagine(
|
||||
region: string,
|
||||
projectId: string,
|
||||
callbacks?: { onProjectNameChange?: (name: string) => void }
|
||||
) {
|
||||
try {
|
||||
const { initImagineConfig, initImagineRouting } = await getWebComponents();
|
||||
|
||||
@@ -281,7 +285,8 @@ export async function initImagine(region: string, projectId: string) {
|
||||
APPWRITE_ENDPOINT: PUBLIC_APPWRITE_ENDPOINT
|
||||
},
|
||||
{
|
||||
initialTheme: get(app).themeInUse
|
||||
initialTheme: get(app).themeInUse,
|
||||
callbacks
|
||||
}
|
||||
);
|
||||
configInitialized = true;
|
||||
|
||||
@@ -15,23 +15,18 @@
|
||||
onMount(() => {
|
||||
ensureStudioComponent();
|
||||
|
||||
initImagine(region, projectId);
|
||||
initImagine(region, projectId, {
|
||||
onProjectNameChange: () => {
|
||||
invalidate(Dependencies.PROJECT);
|
||||
}
|
||||
});
|
||||
|
||||
return app.subscribe(async ($app) => {
|
||||
const { changeTheme, initImagineCallbacks } = await getWebComponents();
|
||||
|
||||
try {
|
||||
const { changeTheme } = await getWebComponents();
|
||||
if (changeTheme) {
|
||||
changeTheme($app.themeInUse);
|
||||
}
|
||||
|
||||
if (initImagineCallbacks) {
|
||||
initImagineCallbacks({
|
||||
onProjectNameChange: () => {
|
||||
invalidate(Dependencies.PROJECT);
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to change theme:', error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user