add analytics toggling

This commit is contained in:
Keviin Åberg Kultalahti 2021-05-05 18:39:36 +02:00
parent ef129b7595
commit ae43bbe008
2 changed files with 4 additions and 9 deletions

View File

@ -25,11 +25,12 @@
let loading = false let loading = false
let company = $organisation?.company $: company = $organisation?.company
let logoUrl = $organisation.logoUrl $: logoUrl = $organisation.logoUrl
async function saveConfig() { async function saveConfig() {
loading = true loading = true
await toggleAnalytics()
const res = await organisation.save({ ...$organisation, company }) const res = await organisation.save({ ...$organisation, company })
if (res.status === 200) { if (res.status === 200) {
notifications.success("General settings saved.") notifications.success("General settings saved.")
@ -78,11 +79,7 @@
<div class="fields"> <div class="fields">
<div class="field"> <div class="field">
<Label>Send Analytics to Budibase</Label> <Label>Send Analytics to Budibase</Label>
<Toggle <Toggle text="" value={!analyticsDisabled} />
text=""
bind:value={analyticsDisabled}
on:change={toggleAnalytics}
/>
</div> </div>
</div> </div>
</div> </div>

View File

@ -74,6 +74,4 @@ for (let route of mainRoutes) {
router.use(staticRoutes.routes()) router.use(staticRoutes.routes())
router.use(staticRoutes.allowedMethods()) router.use(staticRoutes.allowedMethods())
router.redirect("/", "/builder")
module.exports = router module.exports = router