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