Przeglądaj źródła

Prevent a double network request

I’m seeing a double network request because the initial value of _query is null. When the initial value is null, the first update calls performSearch, which in turn sets the query to ‘’, which then kicks off another update and search.

I couldn’t see a reason to have the null value as an option for _query, but since it would be backwards-incompatible to change it now (I think), I left it as an option.
Jason Grout 4 lat temu
rodzic
commit
8baaea0b82
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      packages/extensionmanager/src/model.ts

+ 1 - 1
packages/extensionmanager/src/model.ts

@@ -889,7 +889,7 @@ export class ListModel extends VDomModel {
 
   protected translator: ITranslator;
   private _app: JupyterFrontEnd;
-  private _query: string | null = null;
+  private _query: string | null = ''; // TODO: we may not need the null case?
   private _page: number = 0;
   private _pagination: number = 250;
   private _totalEntries: number = 0;