浏览代码

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 年之前
父节点
当前提交
8baaea0b82
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;