diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index 801f119dff..7fcc27ef03 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -16,6 +16,7 @@ import * as appValidation from "helpers/validation/yup/app" import TemplateCard from "components/common/TemplateCard.svelte" import { lowercase } from "helpers" + import { sdk } from "@budibase/shared-core" export let template @@ -141,6 +142,11 @@ // Create user await auth.setInitInfo({}) + if (sdk.users.isCreator($auth.user, app?.devId)) { + // Refresh for access to created applications + await auth.getSelf() + } + $goto(`/builder/app/${createdApp.instance._id}`) } catch (error) { creating = false diff --git a/packages/builder/src/components/start/DuplicateAppModal.svelte b/packages/builder/src/components/start/DuplicateAppModal.svelte index 2386d34437..a37e7f2b22 100644 --- a/packages/builder/src/components/start/DuplicateAppModal.svelte +++ b/packages/builder/src/components/start/DuplicateAppModal.svelte @@ -9,9 +9,10 @@ import { createValidationStore } from "helpers/validation/yup" import { writable, get } from "svelte/store" import * as appValidation from "helpers/validation/yup/app" - import { appsStore } from "stores/portal" + import { appsStore, auth } from "stores/portal" import { onMount } from "svelte" import { API } from "api" + import { sdk } from "@budibase/shared-core" export let appId export let appName @@ -69,6 +70,10 @@ try { await API.duplicateApp(data, appId) appsStore.load() + if (sdk.users.isCreator($auth.user, app?.devId)) { + // Refresh for access to created applications + await auth.getSelf() + } onDuplicateSuccess() notifications.success("App duplicated successfully") } catch (err) {