From 3b28d9a1d587ea77f6b9b1ebbc9c7be207c5d6c8 Mon Sep 17 00:00:00 2001 From: ennucore Date: Sun, 10 Sep 2023 15:59:24 +0200 Subject: [PATCH 1/4] api.agorata.io -> agorata.io/api --- src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index 9ff7fd6..90e1303 100644 --- a/src/api.ts +++ b/src/api.ts @@ -19,7 +19,7 @@ export class Api { this.ton_api_url = "https://testnet.tonapi.io/v2/"; this.tonscan_url = "https://testnet.tonscan.org/"; } else { - this.api_url = "https://api.agorata.io/"; + this.api_url = "https://agorata.io/api"; this.ton_api_url = "https://tonapi.io/v2/"; this.tonscan_url = "https://tonscan.org/"; } From e4ce4e189d6557b48428a48d41b9cd37dc2cb21a Mon Sep 17 00:00:00 2001 From: ennucore Date: Sun, 10 Sep 2023 16:02:50 +0200 Subject: [PATCH 2/4] fix api url --- src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index 90e1303..6eb7820 100644 --- a/src/api.ts +++ b/src/api.ts @@ -19,7 +19,7 @@ export class Api { this.ton_api_url = "https://testnet.tonapi.io/v2/"; this.tonscan_url = "https://testnet.tonscan.org/"; } else { - this.api_url = "https://agorata.io/api"; + this.api_url = "https://agorata.io/api/"; this.ton_api_url = "https://tonapi.io/v2/"; this.tonscan_url = "https://tonscan.org/"; } From f97fef7164412aa5a06b49cbee2434506269b6e4 Mon Sep 17 00:00:00 2001 From: ennucore Date: Sun, 10 Sep 2023 16:14:12 +0200 Subject: [PATCH 3/4] fix constructor --- src/views/Explore.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Explore.vue b/src/views/Explore.vue index b291e3d..111bf7d 100644 --- a/src/views/Explore.vue +++ b/src/views/Explore.vue @@ -212,7 +212,7 @@ export default { this.constructor_params !== this.saved_constructor_params; } return ( - this.records && (this.site_rec !== this.records.site || constr_change) + this.records && (this.site_rec !== this.records.site || constr_change) || (!this.records && constr_change) ); }, settingsCompLoaded() { From 52ad71712e3435850242f3f48fe695a02cece3df Mon Sep 17 00:00:00 2001 From: ennucore Date: Mon, 11 Sep 2023 09:14:25 +0200 Subject: [PATCH 4/4] Fix constructor on the frontend --- src/api.ts | 2 +- src/components/SiteSettings.vue | 24 ++++++++++++++++++++++-- src/views/Explore.vue | 13 +++++++++---- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/api.ts b/src/api.ts index 6eb7820..19a21ee 100644 --- a/src/api.ts +++ b/src/api.ts @@ -14,7 +14,7 @@ export class Api { "ed4f2afebb5e49dda9684a474c5771141be1f7d85a2fa39f1823844dd476c52d"; constructor() { - if (process.env.NODE_ENV === "development") { + if (process.env.NODE_ENV === "development" && false) { this.api_url = "http://localhost:5170/"; this.ton_api_url = "https://testnet.tonapi.io/v2/"; this.tonscan_url = "https://testnet.tonscan.org/"; diff --git a/src/components/SiteSettings.vue b/src/components/SiteSettings.vue index c493f05..fc6a0b2 100644 --- a/src/components/SiteSettings.vue +++ b/src/components/SiteSettings.vue @@ -29,7 +29,7 @@ :class="{ 'record-submit': true, get_b: true, - inactive: !siteChanged, + inactive: inactiveSave, signing: signingSite, }" @click="$emit('save')" @@ -65,6 +65,14 @@ @@ -101,7 +109,10 @@ export default { }, data() { let site_rec = this.site_rec_init; - if (!site_rec) site_rec = config.agorata_adnl; + if (!site_rec) { + site_rec = config.agorata_adnl; + this.$emit("change", this.site_rec); + } let constructor_site = site_rec.toLowerCase() === config.agorata_adnl.toLowerCase(); return { @@ -150,6 +161,11 @@ export default { return this.site_rec; } }, + inactiveSave() { + return ( + !this.siteChanged && this.site_rec !== null + ); + }, link_types() { // return the types from link_types that are not in the constructor_params.contacts return link_types.filter( @@ -184,6 +200,10 @@ export default { }, mounted() { this.setTemplates(); + if (this.site_rec === null ) { + this.site_rec = config.agorata_adnl; + this.$emit("change", this.site_rec); + } }, }; diff --git a/src/views/Explore.vue b/src/views/Explore.vue index 111bf7d..3b4ec3e 100644 --- a/src/views/Explore.vue +++ b/src/views/Explore.vue @@ -80,7 +80,7 @@ @save="saveSite()" @save-constructor="saveSiteConstr()" @change="site_rec = $event" - @change-constructor="constructor_params = $event" + @change-constructor="constructor_params = $event; constructor_params.domain = domain" :site-changed="siteChanged" :signing-site="signingSite" /> @@ -212,7 +212,7 @@ export default { this.constructor_params !== this.saved_constructor_params; } return ( - this.records && (this.site_rec !== this.records.site || constr_change) || (!this.records && constr_change) + (this.records && (this.site_rec !== this.records.site || constr_change)) || (!this.records && constr_change) || (this.records !== null && this.site_rec === null) ); }, settingsCompLoaded() { @@ -283,6 +283,7 @@ export default { if (this.site_rec !== this.records.site) { await this.saveSite(); } + this.constructor_params.domain = this.domain; await call_api_post("set-site-data", this.constructor_params); this.saved_constructor_params = this.constructor_params; this.updSettingsComponent(); @@ -306,11 +307,15 @@ export default { records: function (val) { if (val) { this.wallet_rec = val.wallet; - this.site_rec = val.site; + if (!this.site_rec || val.site) { + this.site_rec = val.site; + } } }, site_rec() { - this.$refs.site_settings.set_site_rec(this.site_rec); + if (this.$refs.site_settings) { + this.$refs.site_settings.set_site_rec(this.site_rec); + } }, saved_constructor_params() { this.$refs.site_settings.saved_constructor_params =