fix: show config parse error and writable warnings independently

A mounted config file can be both malformed and not writable at once. The
v-else-if chain hid the not-writable warning when a parse error was present,
even though edit controls stay disabled. Show both alerts independently when
the file is mounted.

Generated-By: PostHog Code
Task-Id: 3d4f28a8-5157-4ca4-97a6-f283f5d6329e
This commit is contained in:
Georges-Antoine Assi
2026-07-09 19:54:33 -04:00
parent 28aa53107b
commit e95281748d
2 changed files with 10 additions and 4 deletions

View File

@@ -83,7 +83,10 @@ const tabModel = computed<string>({
</template>
{{ t("settings.config-file-not-mounted-desc") }}
</RAlert>
<RAlert v-else-if="config.CONFIG_FILE_PARSE_ERROR" type="error">
<RAlert
v-if="config.CONFIG_FILE_MOUNTED && config.CONFIG_FILE_PARSE_ERROR"
type="error"
>
<template #title>
{{ t("settings.config-file-parse-error-title") }}
</template>
@@ -93,7 +96,10 @@ const tabModel = computed<string>({
})
}}
</RAlert>
<RAlert v-else-if="!config.CONFIG_FILE_WRITABLE" type="warning">
<RAlert
v-if="config.CONFIG_FILE_MOUNTED && !config.CONFIG_FILE_WRITABLE"
type="warning"
>
<template #title>
{{ t("settings.config-file-not-writable-title") }}
</template>

View File

@@ -85,7 +85,7 @@ watch(
</template>
</v-alert>
<v-alert
v-else-if="config.CONFIG_FILE_PARSE_ERROR"
v-if="config.CONFIG_FILE_MOUNTED && config.CONFIG_FILE_PARSE_ERROR"
type="error"
variant="tonal"
class="my-2"
@@ -102,7 +102,7 @@ watch(
</template>
</v-alert>
<v-alert
v-else-if="!config.CONFIG_FILE_WRITABLE"
v-if="config.CONFIG_FILE_MOUNTED && !config.CONFIG_FILE_WRITABLE"
type="warning"
variant="tonal"
class="my-2"