mirror of
https://github.com/darmiel/yaxc.git
synced 2024-11-13 03:05:40 +08:00
Fixed Base64 upload
This commit is contained in:
parent
ec8e24bd39
commit
8beca5d0db
1 changed files with 0 additions and 16 deletions
|
@ -1,13 +1,11 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/atotto/clipboard"
|
||||
"github.com/darmiel/yaxc/internal/api"
|
||||
"github.com/darmiel/yaxc/internal/common"
|
||||
"github.com/muesli/termenv"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -54,10 +52,6 @@ func (c *Check) CheckServer() (err error) {
|
|||
cb, _ = common.GetClipboard(c.useBase64)
|
||||
empty := cb == ""
|
||||
|
||||
if c.useBase64 {
|
||||
cb = base64.StdEncoding.EncodeToString([]byte(cb))
|
||||
}
|
||||
|
||||
if !empty {
|
||||
// calculate hash
|
||||
var ch string
|
||||
|
@ -83,16 +77,6 @@ func (c *Check) CheckServer() (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
if c.useBase64 {
|
||||
var b []byte
|
||||
if b, err = base64.StdEncoding.DecodeString(sd); err != nil {
|
||||
return
|
||||
}
|
||||
sd = string(b)
|
||||
fmt.Println(common.StyleInfo(), "Decoded clipboard to",
|
||||
termenv.String(sd).Foreground(common.Profile().Color("#66C2CD")))
|
||||
}
|
||||
|
||||
// update contents
|
||||
c.previousClipboard = sd
|
||||
err = common.WriteClipboard(sd, c.useBase64)
|
||||
|
|
Loading…
Reference in a new issue