sort mappings

This commit is contained in:
matth@ultra 2024-09-04 12:06:53 +02:00
parent 0eb07b8de5
commit b1741f2b87

View File

@ -61,7 +61,7 @@ function addMapping(key, directory) {
let mappings = new Map(JSON.parse(localStorage.getItem('mappings')) || []); let mappings = new Map(JSON.parse(localStorage.getItem('mappings')) || []);
statusLine.innerHTML = (mappings.has(key) ? "Changed" : "Added") + ` mapping '${key}' - '${directory}'`; statusLine.innerHTML = (mappings.has(key) ? "Changed" : "Added") + ` mapping '${key}' - '${directory}'`;
mappings.set(key, directory); mappings.set(key, directory);
localStorage.setItem('mappings', JSON.stringify(Array.from(mappings.entries()))); localStorage.setItem('mappings', JSON.stringify(Array.from(mappings.entries()).sort()));
renderMappings(); renderMappings();
} }