Skip to content

Commit d418cd7

Browse files
committed
Fix cross-region deployment preview screenshots (include region)
1 parent 22ee0fc commit d418cd7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/routes/(console)/project-[region]-[project]/sites/(components)/siteCard.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { humanFileSize } from '$lib/helpers/sizeConvertion';
44
import { formatTimeDetailed } from '$lib/helpers/timeConversion';
55
import type { Models } from '@appwrite.io/console';
6+
import { page } from '$app/state';
67
import {
78
Badge,
89
Divider,
@@ -45,7 +46,10 @@
4546
}
4647
4748
function getFilePreview(fileId: string) {
48-
return sdk.forConsole.storage.getFileView('screenshots', fileId);
49+
// Project SDK with `console` project ID = Console SDK with region prefix
50+
return sdk
51+
.forProject(page.params.region, 'console')
52+
.storage.getFileView('screenshots', fileId);
4953
}
5054
</script>
5155

src/routes/(console)/project-[region]-[project]/sites/grid.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
}
3434
3535
function getFilePreview(fileId: string) {
36-
return sdk.forConsole.storage.getFileView('screenshots', fileId);
36+
// Project SDK with `console` project ID = Console SDK with region prefix
37+
return sdk
38+
.forProject(page.params.region, 'console')
39+
.storage.getFileView('screenshots', fileId);
3740
}
3841
</script>
3942

0 commit comments

Comments
 (0)