@flowselections/scan-module 1.0.15 → 1.0.19
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.
- package/dist-lib/components/ScanModulePage.js +4 -4
- package/dist-lib/components/scanners/EindcontroleScanner.d.ts.map +1 -1
- package/dist-lib/components/scanners/EindcontroleScanner.js +84 -11
- package/dist-lib/components/scanners/KarHistorie.d.ts.map +1 -1
- package/dist-lib/components/scanners/KarHistorie.js +2 -1
- package/dist-lib/components/scanners/KarIndelingScanner.d.ts.map +1 -1
- package/dist-lib/components/scanners/KarIndelingScanner.js +1 -1
- package/dist-lib/components/scanners/ScanMonitoring.js +1 -1
- package/dist-lib/components/scanners/ScannerBySlug.js +2 -2
- package/dist-lib/components/scanners/Veilingbrief.js +1 -1
- package/dist-lib/components/settings/ScanModuleSettingsCard.d.ts.map +1 -1
- package/dist-lib/components/settings/ScanModuleSettingsCard.js +1 -1
- package/dist-lib/hooks/useKarIndeling.d.ts +4 -1
- package/dist-lib/hooks/useKarIndeling.d.ts.map +1 -1
- package/dist-lib/hooks/useKarIndeling.js +8 -7
- package/dist-lib/hooks/useKarScanner.d.ts.map +1 -1
- package/dist-lib/hooks/useKarScanner.js +3 -2
- package/dist-lib/hooks/useScanEngine.js +1 -1
- package/dist-lib/hooks/useScanModuleData.d.ts.map +1 -1
- package/dist-lib/hooks/useScanModuleData.js +2 -1
- package/dist-lib/hooks/useScanStats.js +1 -1
- package/dist-lib/hooks/useScanners.d.ts.map +1 -1
- package/dist-lib/hooks/useScanners.js +2 -1
- package/dist-lib/integrations/supabase/client.d.ts +2 -2
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.js +4 -13
- package/dist-lib/integrations/supabase/previewAuthStorage.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/previewAuthStorage.js +22 -4
- package/dist-lib/integrations/supabase/types.d.ts +464 -2
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.js +1 -0
- package/dist-lib/lib/datum.d.ts +3 -0
- package/dist-lib/lib/datum.d.ts.map +1 -0
- package/dist-lib/lib/datum.js +28 -0
- package/dist-lib/lib/pakbonScan.js +1 -1
- package/dist-lib/lib/scanI18n.js +15 -15
- package/dist-lib/lib/scannerTypes.js +1 -1
- package/dist-lib/lib/scanners.js +1 -1
- package/dist-lib/lib/veilingbonPrint.js +2 -2
- package/package.json +4 -4
|
@@ -61,21 +61,38 @@ export function brokeredPreviewStorage() {
|
|
|
61
61
|
// The editor may not be listening yet at the first getItem, so retry once.
|
|
62
62
|
let firstGet = true;
|
|
63
63
|
const RETRY_DELAY = 250;
|
|
64
|
+
// Blocked third-party storage throws here; seeding must not break broker reads.
|
|
65
|
+
const readLocal = (key) => { try {
|
|
66
|
+
return localStorage.getItem(key);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return undefined;
|
|
70
|
+
} };
|
|
64
71
|
return {
|
|
65
72
|
getItem: async (key) => {
|
|
66
|
-
|
|
73
|
+
// Sent with GET and REMOVE so an editor that never cached this session can check or revoke it.
|
|
74
|
+
const local = readLocal(key);
|
|
75
|
+
let res = await request('lovable-preview-auth:get', key, local ?? undefined);
|
|
67
76
|
if (!res && firstGet) {
|
|
68
77
|
await new Promise((r) => setTimeout(r, RETRY_DELAY));
|
|
69
|
-
res = await request('lovable-preview-auth:get', key);
|
|
78
|
+
res = await request('lovable-preview-auth:get', key, local ?? undefined);
|
|
70
79
|
}
|
|
71
80
|
firstGet = false;
|
|
72
81
|
// '' is the logout tombstone: clear the local copy too so it can't resurrect if
|
|
73
82
|
// the broker later goes silent. A null reply means never-synced -> keep local.
|
|
74
83
|
if (res && res.ok && typeof res.value === 'string') {
|
|
75
84
|
if (res.value === '') {
|
|
76
|
-
|
|
85
|
+
if (local !== undefined && readLocal(key) === local)
|
|
86
|
+
localStorage.removeItem(key);
|
|
77
87
|
return null;
|
|
78
88
|
}
|
|
89
|
+
// Seed this origin so a new tab, whose editor holds no session, stays signed in.
|
|
90
|
+
if (local === null && readLocal(key) === null) {
|
|
91
|
+
try {
|
|
92
|
+
localStorage.setItem(key, res.value);
|
|
93
|
+
}
|
|
94
|
+
catch { /* storage full: still return the editor's session */ }
|
|
95
|
+
}
|
|
79
96
|
return res.value;
|
|
80
97
|
}
|
|
81
98
|
return localStorage.getItem(key);
|
|
@@ -92,8 +109,9 @@ export function brokeredPreviewStorage() {
|
|
|
92
109
|
});
|
|
93
110
|
},
|
|
94
111
|
removeItem: (key) => {
|
|
112
|
+
const local = readLocal(key);
|
|
95
113
|
localStorage.removeItem(key);
|
|
96
|
-
return request('lovable-preview-auth:remove', key).then(() => undefined);
|
|
114
|
+
return request('lovable-preview-auth:remove', key, local ?? undefined).then(() => undefined);
|
|
97
115
|
},
|
|
98
116
|
};
|
|
99
117
|
}
|