Skip to content

Commit

Permalink
Let server component handle this, stops crashing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelWTF committed Oct 8, 2024
1 parent e7bbca5 commit 73aab6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Fika.Core/Networking/Websocket/FikaNotificationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public static void TestNotification(EFikaNotifications type)
PushNotification PushNotification = new()
{
Notification = "Test notification",
NotificationIcon = "0"
NotificationIcon = EFT.Communications.ENotificationIconType.Note
};

Singleton<PreloaderUI>.Instance.NotifierView.method_3(PushNotification);
Expand Down
26 changes: 2 additions & 24 deletions Fika.Core/Networking/Websocket/Notifications/PushNotification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,7 @@ public override ENotificationIconType Icon
{
get
{
//Do some exception handling, icon 6 seems to cause an exception, so does going out of the enum's bounds.
try
{
int iconInt = Convert.ToInt32(Icon);

if (iconInt == 6 || iconInt > 14)
{
return ENotificationIconType.Default;
}
}
catch(Exception)
{
return ENotificationIconType.Default;
}

if (Enum.TryParse(NotificationIcon, out ENotificationIconType icon))
{
return icon;
}
else
{
return ENotificationIconType.Default;
}
return NotificationIcon;
}
}

Expand All @@ -46,7 +24,7 @@ public override string Description
}

[JsonProperty("notificationIcon")]
public string NotificationIcon;
public ENotificationIconType NotificationIcon;
[JsonProperty("notification")]
public string Notification;
}
Expand Down

0 comments on commit 73aab6d

Please sign in to comment.