mirror of
https://github.com/FoggedLens/iD.git
synced 2026-06-05 14:38:05 +02:00
Make favorites list last in, first out
This commit is contained in:
@@ -333,11 +333,11 @@ export function coreContext() {
|
||||
} else {
|
||||
// only allow 10 favorites
|
||||
if (favs.length === 10) {
|
||||
// remove the last favorite (first in, first out)
|
||||
// remove the last favorite (last in, first out)
|
||||
favs.pop();
|
||||
}
|
||||
// prepend array
|
||||
favs.unshift({id: preset.id, geom: geom});
|
||||
// append array
|
||||
favs.push({id: preset.id, geom: geom});
|
||||
}
|
||||
setFavoritePresets(favs);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user