File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export class Launcher extends search.Search {
2828 options_array : Array < SearchOption > = new Array ( )
2929 windows : arena . Arena < ShellWindow > = new arena . Arena ( )
3030 service : null | service . LauncherService = null
31+ append_id : null | number = null
3132
3233 constructor ( ext : Ext ) {
3334 super ( )
@@ -103,7 +104,12 @@ export class Launcher extends search.Search {
103104 this . close ( )
104105 } else if ( "Update" in response ) {
105106 this . clear ( )
106- GLib . idle_add ( GLib . PRIORITY_DEFAULT , ( ) => {
107+ if ( this . append_id !== null ) {
108+ GLib . source_remove ( this . append_id )
109+ this . append_id = null
110+ }
111+
112+ this . append_id = GLib . idle_add ( GLib . PRIORITY_DEFAULT , ( ) => {
107113 const item = response . Update . shift ( )
108114 if ( item ) {
109115 try {
@@ -131,7 +137,12 @@ export class Launcher extends search.Search {
131137 }
132138 }
133139
134- return response . Update . length !== 0
140+ if ( response . Update . length === 0 ) {
141+ this . append_id = null
142+ return false
143+ }
144+
145+ return true
135146 } )
136147 } else if ( "Fill" in response ) {
137148 this . set_text ( response . Fill )
You can’t perform that action at this time.
0 commit comments