mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
use: derived.
This commit is contained in:
1 parent
4af5e8334f
commit
72ddec4493
1 file changed
+9
-8
@@ -45,7 +45,15 @@
|
||||
platforms: Array<Models.Platform>;
|
||||
} = $props();
|
||||
|
||||
let platformMap = $state(new Map<string, Models.Platform>());
|
||||
const platformMap = $derived.by(() => {
|
||||
const map = new Map<string, Models.Platform>();
|
||||
platforms.forEach((platform) => {
|
||||
const platformInfo = getPlatformInfo(platform.type);
|
||||
map.set(platformInfo.name, platform);
|
||||
});
|
||||
|
||||
return map;
|
||||
});
|
||||
|
||||
const projectRoute = $derived.by(() => {
|
||||
return resolve('/(console)/project-[region]-[project]', {
|
||||
@@ -54,13 +62,6 @@
|
||||
});
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
platforms.forEach((platform) => {
|
||||
const platformInfo = getPlatformInfo(platform.type);
|
||||
platformMap.set(platformInfo.name, platform);
|
||||
});
|
||||
});
|
||||
|
||||
function createKey() {
|
||||
trackEvent(Click.KeyCreateClick, { source: 'onboarding' });
|
||||
|
||||
|
||||
Reference in new issue
Block a user