bug: try to fix some multimap weirdness
This commit is contained in:
parent
01c00b1e85
commit
7f343319d5
2 changed files with 26 additions and 9 deletions
20
.idea/workspace.xml
generated
20
.idea/workspace.xml
generated
|
@ -7,14 +7,17 @@
|
||||||
<cargoProject FILE="$PROJECT_DIR$/Cargo.toml" />
|
<cargoProject FILE="$PROJECT_DIR$/Cargo.toml" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="2d855648-9644-469a-afa2-59beb52bb1d6" name="Changes" comment="feat: new ui" />
|
<list default="true" id="2d855648-9644-469a-afa2-59beb52bb1d6" name="Changes" comment="bug: try to fix some multimap weirdness">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/client/src/routes/+page.svelte" beforeDir="false" afterPath="$PROJECT_DIR$/client/src/routes/+page.svelte" afterDir="false" />
|
||||||
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="DarkyenusTimeTracker">
|
<component name="DarkyenusTimeTracker">
|
||||||
<option name="totalTimeSeconds" value="23936" />
|
<option name="totalTimeSeconds" value="25084" />
|
||||||
</component>
|
</component>
|
||||||
<component name="FileTemplateManagerImpl">
|
<component name="FileTemplateManagerImpl">
|
||||||
<option name="RECENT_TEMPLATES">
|
<option name="RECENT_TEMPLATES">
|
||||||
|
@ -207,7 +210,15 @@
|
||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1748921263065</updated>
|
<updated>1748921263065</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="10" />
|
<task id="LOCAL-00010" summary="bug: try to fix some multimap weirdness">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1748921698886</created>
|
||||||
|
<option name="number" value="00010" />
|
||||||
|
<option name="presentableId" value="LOCAL-00010" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1748921698886</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="11" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
|
@ -224,6 +235,7 @@
|
||||||
<MESSAGE value="feat: fix singlesite rendering, works on all sites now" />
|
<MESSAGE value="feat: fix singlesite rendering, works on all sites now" />
|
||||||
<MESSAGE value="chore: prep for migration" />
|
<MESSAGE value="chore: prep for migration" />
|
||||||
<MESSAGE value="feat: new ui" />
|
<MESSAGE value="feat: new ui" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="feat: new ui" />
|
<MESSAGE value="bug: try to fix some multimap weirdness" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="bug: try to fix some multimap weirdness" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -8,16 +8,21 @@
|
||||||
mapNumber: number
|
mapNumber: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mapgeneratornumber = 1;
|
||||||
|
|
||||||
let maps: MapData[] = $state([{
|
let maps: MapData[] = $state([{
|
||||||
mapNumber: 1
|
mapNumber: mapgeneratornumber
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
function addMap() {
|
function addMap() {
|
||||||
maps.push({ mapNumber: maps.length + 1 });
|
maps.push({ mapNumber: ++mapgeneratornumber });
|
||||||
}
|
}
|
||||||
function removeThisMapFactory(idx: number) {
|
function removeThisMapFactory(idx: number) {
|
||||||
return () => {
|
for (let i = 0; i < maps.length; i++) {
|
||||||
maps.splice(idx, 1);
|
if (maps[i].mapNumber == idx) {
|
||||||
|
maps.splice(i, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -25,7 +30,7 @@
|
||||||
<div class="flex min-h-screen min-w-screen flex-row">
|
<div class="flex min-h-screen min-w-screen flex-row">
|
||||||
{#key maps}
|
{#key maps}
|
||||||
{#each maps as map, i}
|
{#each maps as map, i}
|
||||||
<Map {addMap} removeThisMap={removeThisMapFactory(i)} mapNum={i+1} stations={data.stations} categories={data.layers} />
|
<Map {addMap} removeThisMap={() => {removeThisMapFactory(map.mapNumber)}} mapNum={i+1} stations={data.stations} categories={data.layers} />
|
||||||
{/each}
|
{/each}
|
||||||
{/key}
|
{/key}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue