Fix compilation for Android

This commit is contained in:
2025-06-07 21:00:39 -04:00
parent 0f03096ed2
commit cf5d5051fd
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -12,7 +12,7 @@ import (
// clipClearProcess clears the clipboard after 30 seconds if the clipboard contents have not changed. // clipClearProcess clears the clipboard after 30 seconds if the clipboard contents have not changed.
// assignedContents can be omitted to clear the clipboard immediately and unconditionally. // assignedContents can be omitted to clear the clipboard immediately and unconditionally.
func clipClearProcess(assignedContents string) { func clipClearProcess(assignedContents string) error {
clearClipboard := func() { clearClipboard := func() {
clipboard.Write(clipboard.FmtText, []byte("")) clipboard.Write(clipboard.FmtText, []byte(""))
back.Exit(0) back.Exit(0)
@@ -21,7 +21,7 @@ func clipClearProcess(assignedContents string) {
// if assignedContents is empty, clear the clipboard immediately and unconditionally // if assignedContents is empty, clear the clipboard immediately and unconditionally
if assignedContents == "" { if assignedContents == "" {
clearClipboard() clearClipboard()
return return nil
} }
// wait 30 seconds before checking clipboard contents // wait 30 seconds before checking clipboard contents
@@ -32,4 +32,5 @@ func clipClearProcess(assignedContents string) {
if assignedContents == strings.TrimRight(string(newContents), "\r\n") { if assignedContents == strings.TrimRight(string(newContents), "\r\n") {
clearClipboard() clearClipboard()
} }
return nil
} }
+2 -2
View File
@@ -7,10 +7,10 @@ import (
) )
// copyString copies a string to the clipboard. // copyString copies a string to the clipboard.
func copyString(continuous bool, copySubject string) { func copyString(continuous bool, copySubject string) error {
clipboard.Write(clipboard.FmtText, []byte(copySubject)) clipboard.Write(clipboard.FmtText, []byte(copySubject))
if !continuous { if !continuous {
LaunchClipClearProcess(copySubject) LaunchClipClearProcess(copySubject)
} }
return nil
} }