aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-04-26 15:11:27 +1000
committerTerry Truong <terry06890@gmail.com>2022-04-26 15:11:27 +1000
commitde55b59141a82c68b6a5b360d6f57a7e760e2fd6 (patch)
tree8be1a1bdbb91b8ef7b71e5553f62fff176e8d6af /src/components
parent04e9444746d3ba8ddcc96d0fd16f1c02adce1389 (diff)
Make TolMap have Map type
Diffstat (limited to 'src/components')
-rw-r--r--src/components/SearchModal.vue6
-rw-r--r--src/components/Tile.vue4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue
index 5accd62..9c30cbc 100644
--- a/src/components/SearchModal.vue
+++ b/src/components/SearchModal.vue
@@ -21,14 +21,14 @@ export default defineComponent({
// Query server
let url = new URL(window.location.href);
url.pathname = '/tolnode/' + input.value;
- fetch(url)
+ fetch(url.toString())
.then(response => {
// Search successful. Get nodes in parent-chain, add to tolMap, then emit event.
url.search = '?type=chain';
- fetch(url)
+ fetch(url.toString())
.then(response => response.json())
.then(obj => {
- Object.getOwnPropertyNames(obj).forEach(key => {this.tolMap[key] = obj[key]});
+ Object.getOwnPropertyNames(obj).forEach(key => {this.tolMap.set(key, obj[key])});
this.$emit('search-node', input.value);
})
.catch(error => {
diff --git a/src/components/Tile.vue b/src/components/Tile.vue
index c5c261d..1087a58 100644
--- a/src/components/Tile.vue
+++ b/src/components/Tile.vue
@@ -28,8 +28,8 @@ export default defineComponent({
};
},
computed: {
- tolNode(): TolNode{
- return this.tolMap[this.layoutNode.name];
+ tolNode(): TolNode {
+ return this.tolMap.get(this.layoutNode.name)!;
},
// Basic abbreviations
isLeaf(): boolean {