dsh-unlag 1.9.78 → 1.9.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/client.js +14 -1
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -72,6 +72,14 @@ window.__ModuleLoader__.load({
72
72
  }
73
73
  }
74
74
 
75
+ function stampClear() {
76
+ try {
77
+ window.sessionStorage.removeItem(STAMP_KEY);
78
+ } catch {
79
+ // Pacing is the only thing this stamp feeds: a store that refuses the clear costs nothing.
80
+ }
81
+ }
82
+
75
83
  function stampWrite() {
76
84
  try {
77
85
  window.sessionStorage.setItem(STAMP_KEY, String(Date.now()));
@@ -860,7 +868,6 @@ window.__ModuleLoader__.load({
860
868
  report('replaced');
861
869
  return stop(replaced ? 'replaced' : 'done');
862
870
  }
863
- stampWrite();
864
871
  const reason = await prepareInterface();
865
872
  if (reason !== null) {
866
873
  // The log keeps the exact check that refused, so a held press can be explained later.
@@ -868,6 +875,9 @@ window.__ModuleLoader__.load({
868
875
  report('held', replaced ? `applied:${gate}` : gate);
869
876
  return stop(reason, replaced);
870
877
  }
878
+ // Written only now, when the document really is about to go: a press that was held changed
879
+ // nothing, so the next press must not be turned away as if this one had been answered.
880
+ stampWrite();
871
881
  report('rebuild');
872
882
  navigated = true;
873
883
  reloadFreshPage();
@@ -885,6 +895,9 @@ window.__ModuleLoader__.load({
885
895
  // Still here after asking for a rebuild: the page held the navigation. Say what
886
896
  // happened and take the press back, so the button is never left unresponsive.
887
897
  report('held', 'navigation');
898
+ // The document stayed, so no press was answered: clear the pacing stamp this press
899
+ // wrote, or the next press inside three seconds would be told it is already applying.
900
+ stampClear();
888
901
  setPending(false);
889
902
  // Only a press that really replaced the plugins may say so: a page-only press that
890
903
  // held the navigation changed no code.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-unlag",
3
- "version": "1.9.78",
3
+ "version": "1.9.79",
4
4
  "type": "module",
5
5
  "description": "A press applies plugin edits right away and brings a laggy interface back; automatic reloading stays off unless you turn it on, so the press is the only trigger, and nothing restarts.",
6
6
  "license": "MIT",