refactor: try to fix the issue that pasting into branch/tag name textbox got duplicated text (#1792)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-09-04 19:45:38 +08:00
parent 5b02693047
commit c7d7cb084a

View File

@@ -44,6 +44,8 @@ namespace SourceGit.Views
private async void OnPastingFromClipboard(object sender, RoutedEventArgs e)
{
e.Handled = true;
try
{
var clipboard = TopLevel.GetTopLevel(this)?.Clipboard;
@@ -54,9 +56,9 @@ namespace SourceGit.Views
OnTextInput(new TextInputEventArgs() { Text = text });
}
}
finally
catch
{
e.Handled = true;
// Ignore exceptions
}
}
}