Skip to content

Commit

Permalink
feat: avoid saving again if once already done
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjibansg committed Jul 12, 2023
1 parent 104f571 commit 495b633
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions client/src/components/SubstraitGraph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default {
download: false,
downloadJSON: false,
shareable_link: "",
plan: "",
};
},
mounted() {
Expand Down Expand Up @@ -133,12 +134,14 @@ export default {
},
async generateLink() {
try {
const resp = await axios.post("/api/save/", {
json_string: store.plan,
validator_overrides: store.validation_override_levels,
});
this.shareable_link = this.currentUrl + "/plan/" + resp.data;
if (store.plan != this.plan) {
const resp = await axios.post("/api/save/", {
json_string: store.plan,
validator_overrides: store.validation_override_levels,
});
this.shareable_link = this.currentUrl + "/plan/" + resp.data;
this.plan = store.plan;
}
this.clipboard.onClick({ currentTarget: this.$refs.copyButton });
alert("Link copied to clipboard!");
} catch (error) {
Expand Down

0 comments on commit 495b633

Please sign in to comment.