@@ -492,8 +492,9 @@ export class QueryHistoryManager extends DisposableObject {
492492 singleItem : QueryHistoryInfo ,
493493 multiSelect : QueryHistoryInfo [ ]
494494 ) : Promise < void > {
495+ // TODO will support remote queries
495496 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
496- if ( ! this . assertSingleQuery ( finalMultiSelect ) || finalSingleItem . t !== 'local' ) {
497+ if ( ! this . assertSingleQuery ( finalMultiSelect ) || ( finalSingleItem && finalSingleItem . t !== 'local' ) ) {
497498 return ;
498499 }
499500
@@ -581,7 +582,8 @@ export class QueryHistoryManager extends DisposableObject {
581582 ) : Promise < void > {
582583 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
583584
584- if ( ! this . assertSingleQuery ( finalMultiSelect ) || finalSingleItem . t !== 'local' ) {
585+ // TODO will support remote queries
586+ if ( ! this . assertSingleQuery ( finalMultiSelect ) || finalSingleItem ?. t !== 'local' ) {
585587 return ;
586588 }
587589
@@ -605,7 +607,8 @@ export class QueryHistoryManager extends DisposableObject {
605607 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
606608
607609 try {
608- if ( finalSingleItem . t !== 'local' ) {
610+ // local queries only
611+ if ( finalSingleItem ?. t !== 'local' ) {
609612 throw new Error ( 'Please select a local query.' ) ;
610613 }
611614
@@ -628,8 +631,9 @@ export class QueryHistoryManager extends DisposableObject {
628631 singleItem : QueryHistoryInfo ,
629632 multiSelect : QueryHistoryInfo [ ]
630633 ) {
634+ // TODO will support remote queries
631635 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
632- if ( ! this . assertSingleQuery ( finalMultiSelect ) || finalSingleItem . t !== 'local' ) {
636+ if ( ! this . assertSingleQuery ( finalMultiSelect ) || ( finalSingleItem && finalSingleItem ? .t !== 'local' ) ) {
633637 return ;
634638 }
635639
@@ -660,6 +664,7 @@ export class QueryHistoryManager extends DisposableObject {
660664 singleItem : LocalQueryInfo ,
661665 multiSelect : LocalQueryInfo [ ]
662666 ) {
667+ // Local queries only
663668 if ( ! this . assertSingleQuery ( multiSelect ) ) {
664669 return ;
665670 }
@@ -679,6 +684,8 @@ export class QueryHistoryManager extends DisposableObject {
679684 singleItem : QueryHistoryInfo ,
680685 multiSelect : QueryHistoryInfo [ ]
681686 ) {
687+ // Local queries only
688+ // In the future, we may support cancelling remote queries, but this is not a short term plan.
682689 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
683690
684691 ( finalMultiSelect || [ finalSingleItem ] ) . forEach ( ( item ) => {
@@ -694,7 +701,8 @@ export class QueryHistoryManager extends DisposableObject {
694701 ) {
695702 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
696703
697- if ( ! this . assertSingleQuery ( finalMultiSelect ) || finalSingleItem . t !== 'local' ) {
704+ // TODO will support remote queries
705+ if ( ! this . assertSingleQuery ( finalMultiSelect ) || ( finalSingleItem && finalSingleItem ?. t !== 'local' ) ) {
698706 return ;
699707 }
700708
@@ -719,7 +727,8 @@ export class QueryHistoryManager extends DisposableObject {
719727 ) {
720728 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
721729
722- if ( ! this . assertSingleQuery ( finalMultiSelect ) || finalSingleItem . t !== 'local' || ! finalSingleItem . completedQuery ) {
730+ // Local queries only
731+ if ( ! this . assertSingleQuery ( finalMultiSelect ) || ! finalSingleItem || finalSingleItem . t !== 'local' || ! finalSingleItem . completedQuery ) {
723732 return ;
724733 }
725734
@@ -743,7 +752,8 @@ export class QueryHistoryManager extends DisposableObject {
743752 ) {
744753 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
745754
746- if ( ! this . assertSingleQuery ( finalMultiSelect ) || finalSingleItem . t !== 'local' || ! finalSingleItem . completedQuery ) {
755+ // Local queries only
756+ if ( ! this . assertSingleQuery ( finalMultiSelect ) || ! finalSingleItem || finalSingleItem . t !== 'local' || ! finalSingleItem . completedQuery ) {
747757 return ;
748758 }
749759 const query = finalSingleItem . completedQuery . query ;
@@ -764,7 +774,8 @@ export class QueryHistoryManager extends DisposableObject {
764774 ) {
765775 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
766776
767- if ( ! this . assertSingleQuery ( finalMultiSelect ) || finalSingleItem . t !== 'local' || ! finalSingleItem . completedQuery ) {
777+ // Local queries only
778+ if ( ! this . assertSingleQuery ( finalMultiSelect ) || ! finalSingleItem || finalSingleItem . t !== 'local' || ! finalSingleItem . completedQuery ) {
768779 return ;
769780 }
770781
@@ -779,7 +790,8 @@ export class QueryHistoryManager extends DisposableObject {
779790 ) {
780791 const { finalSingleItem, finalMultiSelect } = this . determineSelection ( singleItem , multiSelect ) ;
781792
782- if ( ! this . assertSingleQuery ( finalMultiSelect ) || finalSingleItem . t !== 'local' || ! finalSingleItem . completedQuery ) {
793+ // Local queries only
794+ if ( ! this . assertSingleQuery ( finalMultiSelect ) || ! finalSingleItem || finalSingleItem . t !== 'local' || ! finalSingleItem . completedQuery ) {
783795 return ;
784796 }
785797
0 commit comments