mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix:cross‑region realtime for deployment logs (NYC); align with Functions pattern
This commit is contained in:
+9
-6
@@ -7,7 +7,7 @@
|
||||
import Aside from '../aside.svelte';
|
||||
import Logs from '../../(components)/logs.svelte';
|
||||
import { Copy, SvgIcon } from '$lib/components';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { realtime } from '$lib/stores/sdk';
|
||||
import { goto } from '$app/navigation';
|
||||
import { onMount } from 'svelte';
|
||||
import { getFrameworkIcon } from '$lib/stores/sites';
|
||||
@@ -18,9 +18,9 @@
|
||||
let deployment = $state(data.deployment);
|
||||
|
||||
onMount(() => {
|
||||
return sdk.forConsole.client.subscribe(
|
||||
'console',
|
||||
async (response: RealtimeResponseEvent<Models.Deployment>) => {
|
||||
const unsubscribe = realtime
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.subscribe('console', async (response: RealtimeResponseEvent<Models.Deployment>) => {
|
||||
if (
|
||||
response.events.includes(
|
||||
`sites.${data.site.$id}.deployments.${data.deployment.$id}.update`
|
||||
@@ -33,8 +33,11 @@
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
return () => {
|
||||
unsubscribe();
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
+9
-6
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Container } from '$lib/layout';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import { realtime } from '$lib/stores/sdk';
|
||||
import { onMount } from 'svelte';
|
||||
import type { Models, RealtimeResponseEvent } from '@appwrite.io/console';
|
||||
import SiteCard from '../../../(components)/siteCard.svelte';
|
||||
@@ -30,9 +30,9 @@
|
||||
let showCancel = $state(false);
|
||||
|
||||
onMount(() => {
|
||||
return sdk.forConsole.client.subscribe(
|
||||
'console',
|
||||
async (response: RealtimeResponseEvent<Models.Deployment>) => {
|
||||
const unsubscribe = realtime
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.subscribe('console', async (response: RealtimeResponseEvent<Models.Deployment>) => {
|
||||
if (
|
||||
response.events.includes(
|
||||
`sites.${page.params.site}.deployments.${page.params.deployment}.update`
|
||||
@@ -40,8 +40,11 @@
|
||||
) {
|
||||
await invalidate(Dependencies.DEPLOYMENT);
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
return () => {
|
||||
unsubscribe();
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user