mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-09-17 11:02:06 +00:00
feat(offline): open entry details from the saved snapshot
Opening an entry while offline needed a request that could not be made. Read it from the snapshot claimed by the signed-in account instead, re-checking ownership after the read so a sign-in mid-read cannot surface another account's data, and let controls marked data-offline-action stay usable in read-only mode.
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
if (navigator.onLine) return;
|
||||
const target = event.target instanceof Element ? event.target : null;
|
||||
if (!target?.closest('button, input, textarea, select, form')) return;
|
||||
if (target.closest('[data-offline-action]')) return;
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
};
|
||||
@@ -313,10 +314,10 @@
|
||||
</div>
|
||||
|
||||
<style>
|
||||
:global(.offline-readonly button),
|
||||
:global(.offline-readonly input),
|
||||
:global(.offline-readonly textarea),
|
||||
:global(.offline-readonly select) {
|
||||
:global(.offline-readonly button:not([data-offline-action])),
|
||||
:global(.offline-readonly input:not([data-offline-action])),
|
||||
:global(.offline-readonly textarea:not([data-offline-action])),
|
||||
:global(.offline-readonly select:not([data-offline-action])) {
|
||||
pointer-events: none;
|
||||
opacity: 0.65;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user