add notifications

This commit is contained in:
2025-06-03 00:13:45 +02:00
parent 091a2123bb
commit 0f09bf8436
27 changed files with 2105 additions and 1799 deletions

View File

@ -14,6 +14,7 @@ const logoFileName = 'icon.svg'
export const useExtensionsStore = defineStore('extensionsStore', () => {
const availableExtensions = ref<IHaexHubExtensionLink[]>([])
const { addNotificationAsync } = useNotificationStore()
const extensionLinks = computed<ISidebarItem[]>(() =>
availableExtensions.value
@ -78,6 +79,7 @@ export const useExtensionsStore = defineStore('extensionsStore', () => {
return true
} catch (error) {
console.error(error)
addNotificationAsync({ type: 'error', text: JSON.stringify(error) })
//throw error //new Error(`Keine Leseberechtigung für Ordner ${extensionDirectory}`);
}
}
@ -176,6 +178,7 @@ export const useExtensionsStore = defineStore('extensionsStore', () => {
*/
return manifest
} catch (error) {
addNotificationAsync({ type: 'error', text: JSON.stringify(error) })
console.error('ERROR readManifestFileAsync', error)
}
}
@ -218,7 +221,12 @@ export const useExtensionsStore = defineStore('extensionsStore', () => {
})
console.log('insert extensions', res)
addNotificationAsync({
type: 'success',
text: `${manifest.name} wurde installiert`,
})
} catch (error) {
addNotificationAsync({ type: 'error', text: JSON.stringify(error) })
throw error
/*
const resourcePath = await resourceDir();