Migrated the clipboard function from Tauri JS to the runtime API using encryption

This commit is contained in:
tsommer committed 2024-08-27 20:25:28 +02:00
1 parent 79afd42195
commit 1d12facd58
5 files changed
+61 -42

No files matched your search

@@ -6,10 +6,8 @@ namespace AIStudio.Tools.Services;
/// Wire up the clipboard service to copy Markdown to the clipboard.
/// We use our own Rust-based clipboard service for this.
/// </summary>
public sealed class MarkdownClipboardService(Rust rust, IJSRuntime jsRuntime, ISnackbar snackbar) : IMudMarkdownClipboardService
public sealed class MarkdownClipboardService(Rust rust, ISnackbar snackbar) : IMudMarkdownClipboardService
{
private IJSRuntime JsRuntime { get; } = jsRuntime;
private ISnackbar Snackbar { get; } = snackbar;
private Rust Rust { get; } = rust;
@@ -18,5 +16,5 @@ public sealed class MarkdownClipboardService(Rust rust, IJSRuntime jsRuntime, IS
/// Gets called when the user wants to copy the Markdown to the clipboard.
/// </summary>
/// <param name="text">The Markdown text to copy.</param>
public async ValueTask CopyToClipboardAsync(string text) => await this.Rust.CopyText2Clipboard(this.JsRuntime, this.Snackbar, text);
public async ValueTask CopyToClipboardAsync(string text) => await this.Rust.CopyText2Clipboard(this.Snackbar, text);
}