Skip to content

Commit

Permalink
Strip all other existence of read_html out as determined in HTML supp…
Browse files Browse the repository at this point in the history
…ort PR conversation

Signed-off-by: TukanDev <contact@tukandev.com>
  • Loading branch information
TukanDev committed Feb 23, 2024
1 parent a39b4e3 commit 97b73ac
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
3 changes: 2 additions & 1 deletion plugins/clipboard-manager/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import { invoke } from "@tauri-apps/api/core";

type ClipResponse = Record<"plainText", { text: string }>;
type ClipHtmlResponse = Record<"html", { html: string, altHtml: string }>;
// Commented this type out as it can come in handy to stay
//type ClipHtmlResponse = Record<"html", { html: string, altHtml: string }>;

/**
* Writes plain text to the clipboard.
Expand Down
8 changes: 0 additions & 8 deletions plugins/clipboard-manager/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,6 @@ pub(crate) async fn write_html<R: Runtime>(
clipboard.write_html(data)
}

#[command]
pub(crate) async fn read_html<R: Runtime>(
_app: AppHandle<R>,
clipboard: State<'_, Clipboard<R>>,
) -> Result<ClipboardContents> {
clipboard.read()
}

#[command]
pub(crate) async fn clear<R: Runtime>(
_app: AppHandle<R>,
Expand Down
11 changes: 0 additions & 11 deletions plugins/clipboard-manager/src/desktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ impl<R: Runtime> Clipboard<R> {
}
}

pub fn read_html(&self) -> crate::Result<ClipboardContents> {
match &self.clipboard {
Ok(clipboard) => {
let html = clipboard.lock().unwrap().get_text()?;
// arboard does not have read_html() as its just text, therefor unable to populate alt_html in this case
Ok(ClipboardContents::Html { html, alt_html: None })
}
Err(e) => Err(crate::Error::Clipboard(e.to_string())),
}
}

pub fn clear(&self) -> crate::Result<()> {
match &self.clipboard {
Ok(clipboard) => {
Expand Down

0 comments on commit 97b73ac

Please sign in to comment.