feat(dui): add disable cache toggle to main menu (#99)

* feat(dui): adds disable cache setting

* fix(dui): excludes non-sharp dui connectors manually with slug check

* chore(dui): adds todo

* feat(dui): adds version check to isDisableCacheSupported
This commit is contained in:
Björn Steinhagen
2026-04-02 11:34:32 +02:00
committed by GitHub
parent 8fc81b0b4e
commit 9d3a623fe6
3 changed files with 62 additions and 5 deletions
+13 -2
View File
@@ -8,11 +8,14 @@ export const useConfigStore = defineStore('configStore', () => {
const userSelectedWorkspaceId = ref<string>()
const config = ref<ConnectorConfig>({ darkTheme: true })
const config = ref<ConnectorConfig>({ darkTheme: true, disableCache: false })
const isDarkTheme = computed(() => {
return config.value?.darkTheme
})
const isCacheDisabled = computed(() => {
return config.value?.disableCache || false
})
const isDevMode = ref(false)
const toggleTheme = () => {
@@ -20,6 +23,11 @@ export const useConfigStore = defineStore('configStore', () => {
$configBinding.updateConfig(config.value)
}
const toggleCache = () => {
config.value.disableCache = !config.value.disableCache
$configBinding.updateConfig(config.value)
}
const setUserSelectedWorkspace = (workspaceId: string) => {
userSelectedWorkspaceId.value = workspaceId
try {
@@ -33,7 +41,8 @@ export const useConfigStore = defineStore('configStore', () => {
const init = async () => {
if (!$configBinding) return
config.value = await $configBinding.getConfig()
const fetchedConfig = await $configBinding.getConfig()
config.value = { disableCache: false, ...fetchedConfig }
const workspacesConfig = await $configBinding.getWorkspacesConfig()
if (workspacesConfig && workspacesConfig.userSelectedWorkspaceId) {
userSelectedWorkspaceId.value = workspacesConfig.userSelectedWorkspaceId
@@ -51,9 +60,11 @@ export const useConfigStore = defineStore('configStore', () => {
config,
hasConfigBindings,
isDarkTheme,
isCacheDisabled,
isDevMode,
userSelectedWorkspaceId,
toggleTheme,
toggleCache,
setUserSelectedWorkspace
}
})