mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
use: derived.
This commit is contained in:
@@ -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