File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ export enum OmniboxMode {
2121 Query ,
2222 Command ,
2323 Prompt ,
24- StatusMessage ,
2524}
2625
2726interface Prompt {
@@ -101,17 +100,12 @@ export class OmniboxManagerImpl implements OmniboxManager {
101100 showStatusMessage ( msg : string , durationMs = 2000 ) {
102101 this . _statusMessage = msg ;
103102 const generation = ++ this . _statusMessageGeneration ;
104- const prevMode = this . _mode ;
105- this . _mode = OmniboxMode . StatusMessage ;
106103 raf . scheduleFullRedraw ( ) ;
107104 if ( durationMs === 0 ) return ; // Don't auto-reset
108105 setTimeout ( ( ) => {
109106 if ( this . _statusMessageGeneration !== generation ) return ;
110107 raf . scheduleFullRedraw ( ) ;
111108 this . _statusMessage = '' ;
112- if ( this . _mode === OmniboxMode . StatusMessage ) {
113- this . _mode = prevMode ;
114- }
115109 } , durationMs ) ;
116110 }
117111
@@ -160,6 +154,7 @@ export class OmniboxManagerImpl implements OmniboxManager {
160154 reset ( focus = true ) : void {
161155 this . setMode ( defaultMode , focus ) ;
162156 this . _omniboxSelectionIndex = 0 ;
157+ this . _statusMessage = '' ;
163158 raf . scheduleFullRedraw ( ) ;
164159 }
165160
Original file line number Diff line number Diff line change @@ -399,13 +399,15 @@ export class UiMainPerTrace implements m.ClassComponent {
399399 }
400400
401401 private renderOmnibox ( ) : m . Children {
402- const omniboxMode = AppImpl . instance . omnibox . mode ;
403- if ( omniboxMode === OmniboxMode . StatusMessage ) {
402+ const omnibox = AppImpl . instance . omnibox ;
403+ const omniboxMode = omnibox . mode ;
404+ const statusMessage = omnibox . statusMessage ;
405+ if ( statusMessage !== '' ) {
404406 return m (
405407 `.omnibox.message-mode` ,
406408 m ( `input[readonly][disabled][ref=omnibox]` , {
407409 value : '' ,
408- placeholder : AppImpl . instance . omnibox . statusMessage ,
410+ placeholder : statusMessage ,
409411 } ) ,
410412 ) ;
411413 } else if ( omniboxMode === OmniboxMode . Command ) {
You can’t perform that action at this time.
0 commit comments