Skip to content

Commit a45d471

Browse files
authored
Change missing credentials error to not be shown per frame (#116)
1 parent ac79458 commit a45d471

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Assets/Plugins/StreamChat/SampleProject/Scripts/StreamChatClientBehaviour.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ protected void Awake()
5050
viewFactory.Init(viewContext);
5151
_rootView.Init(viewContext);
5252
}
53-
catch (StreamMissingAuthCredentialsException)
53+
catch (StreamMissingAuthCredentialsException e)
5454
{
55+
Debug.LogError(e.Message);
5556
var popup = viewFactory.CreateFullscreenPopup<ErrorPopup>();
5657
popup.SetData("Invalid Authorization Credentials",
5758
$"Please provide valid authorization data into `{_authCredentialsAsset.name}` asset. " +
@@ -65,6 +66,8 @@ protected void Awake()
6566
}
6667
});
6768

69+
_missingCredentials = true;
70+
6871
#if UNITY_EDITOR
6972

7073
StartCoroutine(BlinkProjectAsset(_authCredentialsAsset, popup));
@@ -79,7 +82,7 @@ protected void Awake()
7982

8083
protected void Update()
8184
{
82-
if (_client == null)
85+
if (_client == null || _missingCredentials)
8386
{
8487
return;
8588
}
@@ -99,6 +102,7 @@ protected void Update()
99102
}
100103

101104
private IStreamChatClient _client;
105+
private bool _missingCredentials;
102106

103107
[SerializeField]
104108
private RootView _rootView;

0 commit comments

Comments
 (0)