fix filename not applying
This commit is contained in:
parent
14fdd34964
commit
1a38e0273e
|
@ -689,7 +689,7 @@ export default {
|
|||
|
||||
// ## Export and Import
|
||||
const styleExporter = newExporter({
|
||||
filename: name.value || 'pleroma_theme',
|
||||
filename: () => exports.name.value ?? 'pleroma_theme',
|
||||
mime: 'text/plain',
|
||||
extension: 'piss',
|
||||
getExportedObject: () => exportStyleData.value
|
||||
|
|
|
@ -16,7 +16,8 @@ export const newExporter = ({
|
|||
|
||||
// Create an invisible link with a data url and simulate a click
|
||||
const e = document.createElement('a')
|
||||
e.setAttribute('download', `${filename}.${extension}`)
|
||||
const realFilename = typeof filename === 'function' ? filename() : filename
|
||||
e.setAttribute('download', `${realFilename}.${extension}`)
|
||||
e.setAttribute('href', `data:${mime};base64, ${window.btoa(stringified)}`)
|
||||
e.style.display = 'none'
|
||||
|
||||
|
|
Loading…
Reference in a new issue