http-request-manager 18.13.13 → 18.13.14
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.
|
@@ -923,6 +923,7 @@ class QueryParamsTrackerService {
|
|
|
923
923
|
}
|
|
924
924
|
checkRequestOptions(requestOptions = [], options = {}) {
|
|
925
925
|
this.ensureStateRestored();
|
|
926
|
+
this.tryHydrateStateFromPersistedStore();
|
|
926
927
|
const normalized = this.normalizeRequestOptions(requestOptions);
|
|
927
928
|
if (!normalized.pathKey)
|
|
928
929
|
return false;
|
|
@@ -944,6 +945,7 @@ class QueryParamsTrackerService {
|
|
|
944
945
|
}
|
|
945
946
|
matchesPath(requestOptions = [], expectedPathOptions = []) {
|
|
946
947
|
this.ensureStateRestored();
|
|
948
|
+
this.tryHydrateStateFromPersistedStore();
|
|
947
949
|
const requestPath = this.normalizeRequestOptions(requestOptions).pathKey;
|
|
948
950
|
const expectedPath = this.normalizeRequestOptions(expectedPathOptions).pathKey;
|
|
949
951
|
return Boolean(requestPath) && requestPath === expectedPath;
|
|
@@ -1159,10 +1161,8 @@ class QueryParamsTrackerService {
|
|
|
1159
1161
|
sessionStorage.setItem(TRACKER_SESSION_INIT_KEY, '1');
|
|
1160
1162
|
}
|
|
1161
1163
|
restoreState() {
|
|
1162
|
-
|
|
1163
|
-
if (this.
|
|
1164
|
-
this.state = QueryTrackerStateModel.adapt(syncState);
|
|
1165
|
-
this.cleanupExpiredEntries();
|
|
1164
|
+
this.tryHydrateStateFromPersistedStore();
|
|
1165
|
+
if (Object.keys(this.state.paths).length > 0) {
|
|
1166
1166
|
return;
|
|
1167
1167
|
}
|
|
1168
1168
|
this.localStorageManager.store$(TRACKER_STORE_NAME)
|
|
@@ -1186,6 +1186,17 @@ class QueryParamsTrackerService {
|
|
|
1186
1186
|
}
|
|
1187
1187
|
});
|
|
1188
1188
|
}
|
|
1189
|
+
tryHydrateStateFromPersistedStore() {
|
|
1190
|
+
if (Object.keys(this.state.paths).length > 0) {
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
const syncState = this.localStorageManager.getPersistedStoreSync(TRACKER_STORE_NAME);
|
|
1194
|
+
if (!this.isTrackerState(syncState)) {
|
|
1195
|
+
return;
|
|
1196
|
+
}
|
|
1197
|
+
this.state = QueryTrackerStateModel.adapt(syncState);
|
|
1198
|
+
this.cleanupExpiredEntries();
|
|
1199
|
+
}
|
|
1189
1200
|
persistState() {
|
|
1190
1201
|
this.localStorageManager.storeExists$(TRACKER_STORE_NAME)
|
|
1191
1202
|
.pipe(take(1))
|