Merge pull request 'Added host as prefix to pattern export' (#1962) from JohnBjrk/strudel:add-host-prefix-to-pattern-export into main

Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1962
This commit is contained in:
froos
2026-02-07 21:40:02 +01:00
+2 -1
View File
@@ -207,9 +207,10 @@ export async function exportPatterns() {
const userPatterns = userPattern.getAll();
const blob = new Blob([JSON.stringify(userPatterns)], { type: 'application/json' });
const downloadLink = document.createElement('a');
const prefix = window.location.hostname.split('.').join('_');
downloadLink.href = window.URL.createObjectURL(blob);
const date = new Date().toISOString().split('T')[0];
downloadLink.download = `strudel_patterns_${date}.json`;
downloadLink.download = `${prefix}_patterns_${date}.json`;
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);