feat: show errors from relay
This commit is contained in:
parent
8a64a7b5da
commit
24d2158e6d
|
@ -205,6 +205,12 @@ namespace XIVChatPlugin {
|
|||
|
||||
ImGui.Spacing();
|
||||
|
||||
if ((this.Plugin.Relay?.Status ?? ConnectionStatus.Disconnected) == ConnectionStatus.Disconnected && Relay.ConnectionError != null) {
|
||||
ImGui.TextUnformatted($"Error: {Relay.ConnectionError}");
|
||||
|
||||
ImGui.Spacing();
|
||||
}
|
||||
|
||||
var relayAuth = this.Plugin.Config.RelayAuth ?? "";
|
||||
WithWhiteText(() => ImGui.TextUnformatted("Relay authentication code"));
|
||||
ImGui.PushItemWidth(-1f);
|
||||
|
|
|
@ -24,6 +24,8 @@ namespace XIVChatPlugin {
|
|||
private const string RelayUrl = "wss://relay.xiv.chat/";
|
||||
#endif
|
||||
|
||||
public static string? ConnectionError { get; private set; }
|
||||
|
||||
private bool Disposed { get; set; }
|
||||
|
||||
private Plugin Plugin { get; }
|
||||
|
@ -135,9 +137,11 @@ namespace XIVChatPlugin {
|
|||
switch (message) {
|
||||
case RelaySuccess success:
|
||||
if (success.Success) {
|
||||
ConnectionError = null;
|
||||
this.Status = ConnectionStatus.Connected;
|
||||
} else {
|
||||
PluginLog.LogWarning($"Relay: {success.Info}");
|
||||
ConnectionError = success.Info;
|
||||
this.Status = ConnectionStatus.Disconnected;
|
||||
this.Plugin.StopRelay();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user