Skip to content

Commit

Permalink
fix: template ref type
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Jun 18, 2024
1 parent 7870e81 commit 59e733e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/license.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { nextTick, useApi, usePanel } from 'kirbyuse'
import type { Ref } from 'vue'
import type { ComponentPublicInstance, Ref } from 'vue'
import { t } from './utils'

const LOCALHOST_HOSTNAMES = ['localhost', '127.0.0.1', '[::1]']
const LOCAL_DOMAINS = ['local', 'test', 'ddev.site']

export interface License {
[key: string]: string
}

export interface LicenseOptions {
label: string
apiNamespace: string
Expand Down Expand Up @@ -100,8 +104,8 @@ export function useLicense({
}

const assertActivationIntegrity = async ({ templateRef, license }: {
templateRef: Ref<HTMLElement | null | undefined>
license: boolean | string
templateRef: Ref<ComponentPublicInstance | null | undefined>
license: boolean | string | License
}) => {
if (license !== false) {
return true
Expand All @@ -110,7 +114,7 @@ export function useLicense({
await nextTick()

if (!templateRef.value) {
panel.notification.error('No license key found, but licensing action buttons are missing')
panel.notification.error('Are you trying to hide the activation buttons? Please buy a license.')
return false
}

Expand Down

0 comments on commit 59e733e

Please sign in to comment.