@patch-adams/core 1.4.31 → 1.4.33

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/index.cjs CHANGED
@@ -1302,8 +1302,8 @@ function generateLrsBridgeCode(options) {
1302
1302
  var cached = localStorage.getItem(cacheKey);
1303
1303
  if (cached) {
1304
1304
  var parsed = JSON.parse(cached);
1305
- // TTL: 7 days = 604800000 ms
1306
- if (parsed.timestamp && (Date.now() - parsed.timestamp) < 604800000) {
1305
+ // TTL: 7 days = 604800000 ms; also invalidate if missing bravaisUserId (old cache)
1306
+ if (parsed.timestamp && (Date.now() - parsed.timestamp) < 604800000 && parsed.bravaisUserId) {
1307
1307
  log('Employee data from localStorage cache');
1308
1308
  employeeLookupData = parsed;
1309
1309
  employeeLookupFetched = true;