mirror of
https://github.com/pockethost/pockethost.git
synced 2025-09-13 04:00:11 +00:00
dashboard fix: dont allow create until versions is populated
This commit is contained in:
parent
058be8344b
commit
ea113a9cfe
5
.changeset/selfish-clocks-end.md
Normal file
5
.changeset/selfish-clocks-end.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@pockethost/dashboard': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Dashboard fix: Don't allow instance creation until versions are available
|
@ -1,11 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import {
|
||||||
globalInstancesStore,
|
globalInstancesStore,
|
||||||
isUserPaid,
|
|
||||||
userSubscriptionType,
|
userSubscriptionType,
|
||||||
|
versions,
|
||||||
} from '$util/stores'
|
} from '$util/stores'
|
||||||
import { values } from '@s-libs/micro-dash'
|
import { values } from '@s-libs/micro-dash'
|
||||||
import { SubscriptionType } from 'pockethost/common'
|
|
||||||
import Creator from './Creator.svelte'
|
import Creator from './Creator.svelte'
|
||||||
import Paywall from './Paywall.svelte'
|
import Paywall from './Paywall.svelte'
|
||||||
import { MAX_INSTANCE_COUNTS } from '$src/env'
|
import { MAX_INSTANCE_COUNTS } from '$src/env'
|
||||||
@ -13,9 +12,10 @@
|
|||||||
let instanceCount = 0
|
let instanceCount = 0
|
||||||
let canCreate = false
|
let canCreate = false
|
||||||
$: {
|
$: {
|
||||||
console.log(MAX_INSTANCE_COUNTS[$userSubscriptionType])
|
|
||||||
instanceCount = values($globalInstancesStore).length
|
instanceCount = values($globalInstancesStore).length
|
||||||
canCreate = instanceCount < MAX_INSTANCE_COUNTS[$userSubscriptionType]
|
canCreate =
|
||||||
|
instanceCount < MAX_INSTANCE_COUNTS[$userSubscriptionType] &&
|
||||||
|
$versions.length > 0
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user