Skip to content

Commit

Permalink
fix: save query to proper namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrasd committed Dec 11, 2023
1 parent c16d92d commit 34fac47
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/sync-with-osm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function saveQuery(new_query, callback) {
const preferences = dom.querySelector("preferences");
// clean up existing data
const existing = preferences.querySelectorAll(
`preference[k^="${configs.appname}_query"]`
`preference[k^="${configs.settingNamespace}_query"]`
);
for (const e of existing) {
e.remove();
Expand All @@ -125,7 +125,7 @@ function saveQuery(new_query, callback) {
}
// construct new preferences xml
const new_elem = dom.createElement("preference");
new_elem.setAttribute("k", `${configs.appname}_query-count`);
new_elem.setAttribute("k", `${configs.settingNamespace}_query-count`);
new_elem.setAttribute("v", existing_queries.length);
preferences.appendChild(new_elem);
for (let i = 0; i < existing_queries.length; i++) {
Expand All @@ -145,7 +145,10 @@ function saveQuery(new_query, callback) {

for (let j = 0; j < numParts; j++) {
const new_elem = dom.createElement("preference");
new_elem.setAttribute("k", `${configs.appname}_query_${i}_${j}`);
new_elem.setAttribute(
"k",
`${configs.settingNamespace}_query_${i}_${j}`
);
new_elem.setAttribute("v", queryStr[j]);
preferences.appendChild(new_elem);
}
Expand Down

0 comments on commit 34fac47

Please sign in to comment.