Make favorites list last in, first out

This commit is contained in:
Quincy Morgan
2019-03-06 08:49:17 -05:00
parent 9a539023df
commit 2618565826
+3 -3
View File
@@ -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);
};