chore: add logging for TauriDialog Service
This commit is contained in:
parent
c091b8cd77
commit
0c5ccea9d4
@ -9,7 +9,16 @@ import { DefaultDialogService } from './default'
|
||||
export class TauriDialogService extends DefaultDialogService {
|
||||
async open(options?: DialogOpenOptions): Promise<string | string[] | null> {
|
||||
try {
|
||||
return await open(options)
|
||||
console.log('TauriDialogService: Opening dialog with options:', options)
|
||||
if (options?.filters) {
|
||||
console.log('TauriDialogService: File filters:', options.filters)
|
||||
options.filters.forEach((filter, index) => {
|
||||
console.log(`TauriDialogService: Filter ${index} - Name: "${filter.name}", Extensions:`, filter.extensions)
|
||||
})
|
||||
}
|
||||
const result = await open(options)
|
||||
console.log('TauriDialogService: Dialog result:', result)
|
||||
return result
|
||||
} catch (error) {
|
||||
console.error('Error opening dialog in Tauri:', error)
|
||||
return null
|
||||
|
||||
@ -19,10 +19,14 @@ export class WebDialogService implements DialogService {
|
||||
}
|
||||
|
||||
if (options?.filters) {
|
||||
console.log('WebDialogService: Processing file filters:', options.filters)
|
||||
const extensions = options.filters.flatMap(filter =>
|
||||
filter.extensions.map(ext => `.${ext}`)
|
||||
)
|
||||
input.accept = extensions.join(',')
|
||||
console.log('WebDialogService: Generated extensions with dots:', extensions)
|
||||
const acceptString = extensions.join(',')
|
||||
console.log('WebDialogService: Final accept attribute:', acceptString)
|
||||
input.accept = acceptString
|
||||
}
|
||||
|
||||
input.onchange = (e) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user