Skip to content

Commit

Permalink
Minor type fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
BusterNeece committed Jan 19, 2025
1 parent a9a47fc commit ae1a9a6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/components/Admin/Backups/ConfigureModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</div>

<div
v-if="v$.backup_enabled.$model"
v-if="form.backup_enabled"
class="row g-3"
>
<form-group-field
Expand Down
17 changes: 14 additions & 3 deletions frontend/components/Common/CodemirrorTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

<script setup lang="ts">
import CodeMirror from "vue-codemirror6";
import {useVModel} from "@vueuse/core";
import {computed} from "vue";
import {css} from "@codemirror/lang-css";
import {javascript} from "@codemirror/lang-javascript";
Expand All @@ -18,15 +17,27 @@ import {liquidsoap} from "codemirror-lang-liquidsoap";
import useTheme from "~/functions/theme";
const props = defineProps<{
modelValue: string | null,
modelValue?: string | number | null,
mode: string
}>();
const emit = defineEmits<{
(e: 'update:modelValue', modelValue: string | null): void
}>();
const textValue = useVModel(props, 'modelValue', emit);
const textValue = computed({
get() {
const value = props.modelValue ?? null;
if (value === null) {
return "";
}
return String(value);
},
set(newValue) {
emit('update:modelValue', newValue);
}
});
const lang = computed(() => {
switch (props.mode) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/functions/useVuelidateOnForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type VuelidateValidations<T extends GenericForm = GenericForm> = Validati
export type VuelidateBlankForm<T extends GenericForm = GenericForm> = MaybeRef<T> | BlankFormFunc<T>

export type VuelidateObject<T extends GenericForm = GenericForm> = Validation<ValidationArgs<T>, T>
export type VuelidateRef<T extends GenericForm = GenericForm> = Ref<VuelidateObject<T>>
export type VuelidateRef<T extends GenericForm = GenericForm> = MaybeRef<VuelidateObject<T>>

export function useVuelidateOnForm<T extends GenericForm = GenericForm>(
validations: VuelidateValidations<T> = {} as VuelidateValidations<T>,
Expand Down

0 comments on commit ae1a9a6

Please sign in to comment.