diff --git a/src/components/settings_modal/tabs/style_tab/style_tab.js b/src/components/settings_modal/tabs/style_tab/style_tab.js index e6667236..747649f7 100644 --- a/src/components/settings_modal/tabs/style_tab/style_tab.js +++ b/src/components/settings_modal/tabs/style_tab/style_tab.js @@ -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 diff --git a/src/services/export_import/export_import.js b/src/services/export_import/export_import.js index 397d35a9..8865061f 100644 --- a/src/services/export_import/export_import.js +++ b/src/services/export_import/export_import.js @@ -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'