polfan-server-js-client 0.2.103 → 0.2.105
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/.idea/workspace.xml +48 -24
- package/build/index.cjs.js +10 -11
- package/build/index.cjs.js.map +1 -1
- package/build/index.umd.js +1 -1
- package/build/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/state-tracker/TopicHistoryWindow.ts +8 -9
package/package.json
CHANGED
|
@@ -203,7 +203,7 @@ export abstract class TraversableRemoteCollection<
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
public async jumpTo(id: string): Promise<void> {
|
|
206
|
-
if (this.internalState.ongoing || this._items.has(id)) {
|
|
206
|
+
if (this.internalState.ongoing || (this.state !== WindowState.LIVE && this._items.has(id))) {
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
|
|
@@ -214,18 +214,17 @@ export abstract class TraversableRemoteCollection<
|
|
|
214
214
|
try {
|
|
215
215
|
result = await this.fetchItemsAround(id);
|
|
216
216
|
this.internalState.lastFetchCount = result ? result.length : 0;
|
|
217
|
+
|
|
218
|
+
if (result) {
|
|
219
|
+
this._items.deleteAll(); // Directly call deleteAll to prevent event emit.
|
|
220
|
+
this.addItems(result, 'tail');
|
|
221
|
+
await this.refreshFetchedState();
|
|
222
|
+
}
|
|
217
223
|
} finally {
|
|
218
224
|
this.internalState.ongoing = undefined;
|
|
219
225
|
}
|
|
220
226
|
|
|
221
|
-
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
this._items.deleteAll(); // Directly call deleteAll to prevent event emit.
|
|
226
|
-
this.addItems(result, 'tail');
|
|
227
|
-
this.internalState.current = WindowState.PAST;
|
|
228
|
-
this.emitChangeWithDiff(true, originalState);
|
|
227
|
+
this.emitChangeWithDiff(!!result, originalState);
|
|
229
228
|
}
|
|
230
229
|
|
|
231
230
|
protected abstract fetchLatestItems(): Promise<ItemT[]>;
|