diff --git a/client-vue/src/components/forms/ChannelUpdateForm.vue b/client-vue/src/components/forms/ChannelUpdateForm.vue
index c5d493f1..99918057 100644
--- a/client-vue/src/components/forms/ChannelUpdateForm.vue
+++ b/client-vue/src/components/forms/ChannelUpdateForm.vue
@@ -376,7 +376,7 @@ function deleteChannel() {
}
function subscribeChannel() {
- if ((!store.cfg("app_url") || store.cfg("app_url") == "debug") && store.cfg("twitchapi.twitchapi.eventsub_type") === "webhook") {
+ if ((!store.cfg("app_url") || store.cfg("app_url") == "debug") && store.cfg("twitchapi.eventsub_type") === "webhook") {
alert("Please set the app url in the settings");
return;
}
diff --git a/client-vue/src/components/forms/SettingsForm.vue b/client-vue/src/components/forms/SettingsForm.vue
index ac4dc99e..1fb6a8b1 100644
--- a/client-vue/src/components/forms/SettingsForm.vue
+++ b/client-vue/src/components/forms/SettingsForm.vue
@@ -9,8 +9,8 @@
-
- Under {{ setting.group }}: {{ setting.text }} ({{ setting.help }})
+ Under {{ setting?.group }}: {{ setting?.text }} ({{ setting !== undefined && "help" in setting ? setting.help : "No help" }})
@@ -197,7 +197,7 @@ const { t, te } = useI18n();
const formStatusText = ref("Ready");
const formStatus = ref("IDLE");
const formData = ref<{ config: Record }>({ config: {} });
-const fetchedSettingsFields = ref({});
+const fetchedSettingsFields = ref();
const loading = ref(false);
const searchText = ref("");
@@ -205,13 +205,14 @@ const searchText = ref("");
const settingsGroups = computed((): SettingsGroup[] => {
if (!fetchedSettingsFields.value) return [];
const groups: Record = {};
- for (const key in fetchedSettingsFields.value) {
+ for (const rawKey in fetchedSettingsFields.value) {
+ const key = rawKey as keyof typeof fetchedSettingsFields.value;
const field = fetchedSettingsFields.value[key];
if (!field.group) continue;
if (searchText.value) {
if (
!key.toLowerCase().includes(searchText.value.toLowerCase()) &&
- !field.help?.toLowerCase().includes(searchText.value.toLowerCase()) &&
+ ("help" in field && !field.help?.toLowerCase().includes(searchText.value.toLowerCase())) &&
!field.text?.toLowerCase().includes(searchText.value.toLowerCase())
)
continue;
@@ -232,11 +233,14 @@ const settingsGroups = computed((): SettingsGroup[] => {
*/
});
-const newAndInterestingSettings = computed((): typeof settingsFields => {
- const newSettings: typeof settingsFields = {};
- for (const key in fetchedSettingsFields.value) {
+const newAndInterestingSettings = computed((): Record => {
+ const newSettings: Record = {} as any;
+ for (const rawKey in fetchedSettingsFields.value) {
+ const key = rawKey as keyof typeof fetchedSettingsFields.value;
const field = fetchedSettingsFields.value[key];
- if (field.new) newSettings[key] = field;
+ if (field !== undefined && "new" in field && field.new) {
+ newSettings[key] = field;
+ }
}
return newSettings;
// return fetchedSettingsFields.value.filter((field) => field.new);
@@ -286,8 +290,8 @@ function fetchData(): void {
// set defaults
for (const key in fetchedSettingsFields.value) {
- const field = fetchedSettingsFields.value[key];
- if (field.default !== undefined && formData.value.config[key] === undefined) {
+ const field = fetchedSettingsFields.value[key as keyof typeof fetchedSettingsFields.value];
+ if ("default" in field && field.default !== undefined && formData.value.config[key] === undefined) {
formData.value.config[key] = field.default;
}
}
diff --git a/client-vue/src/components/menu/SideMenu.vue b/client-vue/src/components/menu/SideMenu.vue
index b93c4667..1095a84c 100644
--- a/client-vue/src/components/menu/SideMenu.vue
+++ b/client-vue/src/components/menu/SideMenu.vue
@@ -4,7 +4,7 @@