+
{{ endpointJson.Name }}
{{ address }}
Galaxy: {{ endpointJson.UniverseAddress.RealityIndex + 1 }}
{{ endpointJson.TeleporterType }}
@@ -53,13 +53,6 @@ function removeEndpoint() {
diff --git a/src/stores/endpointData.ts b/src/stores/endpointData.ts
index 2c3d67d..894b686 100644
--- a/src/stores/endpointData.ts
+++ b/src/stores/endpointData.ts
@@ -6,6 +6,7 @@ interface State {
json: TeleportEndpoint[];
filter: string;
filterType: TeleporterTypes | '';
+ jsonError: boolean;
}
export const useEndpointDataStore = defineStore('endpointData', {
@@ -14,11 +15,18 @@ export const useEndpointDataStore = defineStore('endpointData', {
json: [],
filter: '',
filterType: '',
+ jsonError: false,
}),
actions: {
parseJson() {
- this.json = JSON.parse(this.jsonInputString || '[]');
+ try {
+ this.json = JSON.parse(this.jsonInputString || '[]');
+ this.jsonError = false;
+ } catch (error) {
+ console.error(error);
+ this.jsonError = true;
+ }
},
},
});