Refactor -> Avouid explicit usage of pricing url

This commit is contained in:
jvcalderon 2023-05-15 09:00:20 +02:00
parent 3e62cac3a6
commit 17e2a4d7e4
3 changed files with 10 additions and 6 deletions

View File

@ -314,10 +314,11 @@
</Modal>
<AppLimitModal bind:this={appLimitModal} />
<AccountLockedModal bind:this={accountLockedModal} onConfirm={() =>
isOwner
? $licensing.goToUpgradePage()
: window.open("https://budibase.com/pricing/", "_blank")} />
<AccountLockedModal
bind:this={accountLockedModal}
onConfirm={() =>
isOwner ? $licensing.goToUpgradePage() : $licensing.goToPricingPage()}
/>
<style>
.title {

View File

@ -236,8 +236,6 @@
notifications.error("Error fetching user group data")
}
})
let staticUserLimit = $licensing.license.quotas.usage.static.users.value
</script>
<Layout noPadding gap="M">

View File

@ -12,6 +12,7 @@ export const createLicensingStore = () => {
const DEFAULT = {
// navigation
goToUpgradePage: () => {},
goToPricingPage: () => {},
// the top level license
license: undefined,
isFreePlan: true,
@ -71,10 +72,14 @@ export const createLicensingStore = () => {
const goToUpgradePage = () => {
window.location.href = upgradeUrl
}
const goToPricingPage = () => {
window.open("https://budibase.com/pricing/", "_blank")
}
store.update(state => {
return {
...state,
goToUpgradePage,
goToPricingPage,
}
})
},