@@ -97,6 +97,7 @@ export default class ElectronPlatform extends BasePlatform {
9797 private badgeOverlayRenderer ?: BadgeOverlayRenderer ;
9898 private config ! : IConfigOptions ;
9999 private supportedSettings ?: Record < string , boolean > ;
100+ private clientStartedPromiseWithResolvers = Promise . withResolvers < void > ( ) ;
100101
101102 public constructor ( ) {
102103 super ( ) ;
@@ -184,7 +185,9 @@ export default class ElectronPlatform extends BasePlatform {
184185 await this . ipc . call ( "callDisplayMediaCallback" , source ?? { id : "" , name : "" , thumbnailURL : "" } ) ;
185186 } ) ;
186187
187- this . electron . on ( "showToast" , ( ev , { title, description, priority = 40 } ) => {
188+ this . electron . on ( "showToast" , async ( ev , { title, description, priority = 40 } ) => {
189+ await this . clientStartedPromiseWithResolvers . promise ;
190+
188191 const key = uniqueId ( "electron_showToast_" ) ;
189192 const onPrimaryClick = ( ) : void => {
190193 ToastStore . sharedInstance ( ) . dismissToast ( key ) ;
@@ -214,6 +217,10 @@ export default class ElectronPlatform extends BasePlatform {
214217 if ( [ "call_state" ] . includes ( payload . action ) ) {
215218 this . electron . send ( "app_onAction" , payload ) ;
216219 }
220+
221+ if ( payload . action === "client_started" ) {
222+ this . clientStartedPromiseWithResolvers . resolve ( ) ;
223+ }
217224 }
218225
219226 private async initialise ( ) : Promise < void > {
0 commit comments