mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-16 22:20:51 +01:00
Auto-open dev extensions after loading
- Dev extensions are now automatically opened in a window after successful load - Simplified extension finding logic by using devExtensions directly - Fixed table name handling to support both double quotes and backticks in permission manager
This commit is contained in:
@ -196,7 +196,8 @@ impl PermissionManager {
|
|||||||
table_name: &str,
|
table_name: &str,
|
||||||
) -> Result<(), ExtensionError> {
|
) -> Result<(), ExtensionError> {
|
||||||
// Remove quotes from table name if present (from SDK's getTableName())
|
// Remove quotes from table name if present (from SDK's getTableName())
|
||||||
let clean_table_name = table_name.trim_matches('"');
|
// Support both double quotes and backticks (Drizzle uses backticks by default)
|
||||||
|
let clean_table_name = table_name.trim_matches('"').trim_matches('`');
|
||||||
|
|
||||||
// Auto-allow: Extensions have full access to their own tables
|
// Auto-allow: Extensions have full access to their own tables
|
||||||
// Table format: {publicKey}__{extensionName}__{tableName}
|
// Table format: {publicKey}__{extensionName}__{tableName}
|
||||||
|
|||||||
@ -122,6 +122,7 @@ const browseExtensionPathAsync = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const windowManagerStore = useWindowManagerStore()
|
||||||
// Load a dev extension
|
// Load a dev extension
|
||||||
const loadDevExtensionAsync = async () => {
|
const loadDevExtensionAsync = async () => {
|
||||||
if (!extensionPath.value) return
|
if (!extensionPath.value) return
|
||||||
@ -140,9 +141,24 @@ const loadDevExtensionAsync = async () => {
|
|||||||
// Reload list
|
// Reload list
|
||||||
await loadDevExtensionListAsync()
|
await loadDevExtensionListAsync()
|
||||||
|
|
||||||
|
// Get the newly loaded extension info from devExtensions
|
||||||
|
const newlyLoadedExtension = devExtensions.value.find((ext) =>
|
||||||
|
extensionPath.value.includes(ext.name),
|
||||||
|
)
|
||||||
|
|
||||||
// Reload all extensions in the main extension store so they appear in the launcher
|
// Reload all extensions in the main extension store so they appear in the launcher
|
||||||
await loadExtensionsAsync()
|
await loadExtensionsAsync()
|
||||||
|
|
||||||
|
// Open the newly loaded extension
|
||||||
|
if (newlyLoadedExtension) {
|
||||||
|
await windowManagerStore.openWindowAsync({
|
||||||
|
sourceId: newlyLoadedExtension.id,
|
||||||
|
type: 'extension',
|
||||||
|
icon: newlyLoadedExtension.icon || 'i-heroicons-puzzle-piece-solid',
|
||||||
|
title: newlyLoadedExtension.name,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Clear input
|
// Clear input
|
||||||
extensionPath.value = ''
|
extensionPath.value = ''
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user