[openstreetmap/openstreetmap-website] display warning in new note form after too many anonymous notes (PR #5468)

Holger Jeromin notifications at github.com
Sun Jan 5 08:22:51 UTC 2025


@HolgerJeromin commented on this pull request.



> @@ -162,6 +172,9 @@ OSM.NewNote = function (map) {
       newNoteMarker.dragging.disable();
 
       createNote(location, text, (feature) => {
+        if (typeof OSM.user === "undefined") {
+          localStorage.setItem("anonymousNotesCount", anonymousNotesCount + 1);

If we keep `localstorage` (see @AntonKhorev comment):
`localStorage.setItem` can throw an exception.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5468#pullrequestreview-2530845984
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5468/review/2530845984 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250105/01356fae/attachment.htm>


More information about the rails-dev mailing list