Skip to content

Commit

Permalink
Exceptions show as multiline text
Browse files Browse the repository at this point in the history
  • Loading branch information
yogilad committed Oct 29, 2023
1 parent c97753d commit aad3470
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Src/App/Klipboard/Ux/Notifications/NotificationHelper.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
using Klipboard.Utils;
using System.Text;
using Microsoft.Toolkit.Uwp.Notifications;
using Windows.Foundation.Collections;
using Windows.UI.Notifications;

using Klipboard.Utils;


namespace Klipboard
{
Expand Down Expand Up @@ -30,7 +32,10 @@ static NotificationHelper()
args.TryGetValue("title", out var title);
args.TryGetValue("message", out var message);
args.TryGetValue("details", out var details);
new TextViewForm(title, message, details, wordWrap: true).ShowDialog();

var decodeDetails = Encoding.UTF8.GetString(Convert.FromBase64String(details));

new TextViewForm(title, message, decodeDetails, wordWrap: true).ShowDialog();
break;
}
};
Expand All @@ -52,11 +57,12 @@ public void ShowBasicNotification(string title, string message, int timeoutSecon

public void ShowExtendedNotification(string title, string shortMessage, string extraDetails, int timeoutSeconds = AppConstants.DefaultNotificationTime)
{
var encodedExtraDetails = Convert.ToBase64String(Encoding.UTF8.GetBytes(extraDetails));
var buttonArgs = new ToastArguments()
.Add("action", "MessageBox")
.Add("title", title)
.Add("message", shortMessage)
.Add("details", extraDetails);
.Add("details", encodedExtraDetails);


new ToastContentBuilder()
Expand Down

0 comments on commit aad3470

Please sign in to comment.