@@ -102,8 +102,6 @@ export class UserInterface implements ui_constants.UiApi {
102102 /* Getting and sharing */
103103 public gettingStatus :string = null ;
104104 public sharingStatus :string = null ;
105- public unableToGet :boolean = false ;
106- public unableToShare :boolean = false ;
107105 public isSharingDisabled :boolean = false ;
108106 public proxyingId : string ; // ID of the most recent failed proxying attempt.
109107 private userCancelledGetAttempt_ :boolean = false ;
@@ -123,8 +121,6 @@ export class UserInterface implements ui_constants.UiApi {
123121 public portControlSupport = uproxy_core_api . PortControlSupport . PENDING ;
124122 public availableVersion :string = null ;
125123
126- public toastMessage :string = null ;
127-
128124 // Please note that this value is updated periodically so may not reflect current reality.
129125 private isConnectedToCellular_ :boolean = false ;
130126
@@ -267,10 +263,8 @@ export class UserInterface implements ui_constants.UiApi {
267263 ( info :uproxy_core_api . FailedToGetOrGive ) => {
268264 console . error ( 'proxying attempt ' + info . proxyingId + ' failed (giving)' ) ;
269265
270- this . toastMessage = this . i18n_t ( 'UNABLE_TO_SHARE_WITH' , {
271- name : info . name
272- } ) ;
273- this . unableToShare = true ;
266+ let toastMessage = translator_module . i18n_t ( 'UNABLE_TO_SHARE_WITH' , { name : info . name } ) ;
267+ this . backgroundUi . showToast ( toastMessage , false , true ) ;
274268 this . proxyingId = info . proxyingId ;
275269 } ) ;
276270
@@ -291,10 +285,8 @@ export class UserInterface implements ui_constants.UiApi {
291285 if ( user . status === social . UserStatus . CLOUD_INSTANCE_CREATED_BY_LOCAL ) {
292286 this . restartServer_ ( 'digitalocean' ) ;
293287 } else {
294- this . toastMessage = this . i18n_t ( 'UNABLE_TO_GET_FROM' , {
295- name : info . name
296- } ) ;
297- this . unableToGet = true ;
288+ let toastMessage = translator_module . i18n_t ( 'UNABLE_TO_GET_FROM' , { name : info . name } ) ;
289+ this . backgroundUi . showToast ( toastMessage , true , false ) ;
298290 }
299291 }
300292 }
@@ -350,12 +342,12 @@ export class UserInterface implements ui_constants.UiApi {
350342 this . i18n_t ( 'CANCEL' ) ,
351343 this . i18n_t ( 'RESTART_SERVER' )
352344 ) . then ( ( ) => {
353- this . toastMessage = this . i18n_t ( 'RESTARTING_SERVER' ) ;
345+ this . backgroundUi . showToast ( translator_module . i18n_t ( 'RESTARTING_SERVER' ) ) ;
354346 return this . core . cloudUpdate ( {
355347 operation : uproxy_core_api . CloudOperationType . CLOUD_REBOOT ,
356348 providerName : providerName
357349 } ) . then ( ( ) => {
358- this . toastMessage = this . i18n_t ( 'RESTART_SUCCESS' ) ;
350+ this . backgroundUi . showToast ( translator_module . i18n_t ( 'RESTART_SUCCESS' ) ) ;
359351 } ) . catch ( ( e : Error ) => {
360352 this . showDialog ( this . i18n_t ( 'RESTART_FAILURE_TITLE' ) , this . i18n_t ( 'RESTART_FAILURE_TEXT' ) ) ;
361353 } ) ;
0 commit comments