From 51f825c11e88310464e555cc0252b1ff00f95ad0 Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Wed, 2 Feb 2022 13:20:20 +0100 Subject: [PATCH] fix warning when local storage quota is exceeded --- CHANGELOG.md | 9 +++++++++ css/80_app.css | 5 +++++ modules/ui/status.js | 8 ++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16dbce38b..991f491fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,15 @@ _Breaking developer changes, which may affect downstream projects or sites that [@xxxx]: https://github.com/xxxx --> + +# Unreleased + +#### :bug: Bugfixes +* Fix "local storage is exceeded" error message showing up multiple times ([#8930]) + +[#8930]: https://github.com/openstreetmap/iD/pull/8930 + + # 2.20.3 ##### 2022-Jan-31 diff --git a/css/80_app.css b/css/80_app.css index 5608c60c0..b090683bd 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -4698,6 +4698,11 @@ img.tile-debug { } } +.local-storage-full { + display: block; + width: 100%; +} + /* Notification Badges ------------------------------------------------------- */ /* For an icon (e.g. new version) */ diff --git a/modules/ui/status.js b/modules/ui/status.js index aee8ca25e..081756845 100644 --- a/modules/ui/status.js +++ b/modules/ui/status.js @@ -70,8 +70,12 @@ export function uiStatus(context) { osm.on('apiStatusChange.uiStatus', update); context.history().on('storage_error', () => { - selection.call(t.append('osm_api_status.message.local_storage_full')); - selection.attr('class', 'api-status error'); + selection.selectAll('span.local-storage-full').remove(); + selection + .append('span') + .attr('class', 'local-storage-full') + .call(t.append('osm_api_status.message.local_storage_full')); + selection.classed('error', true); }); // reload the status periodically regardless of other factors