Преглед на файлове

refactor(ui/chat): use color package from tcell (replace deprecated tcell.Color* consts)

ayn2op преди 2 месеца
родител
ревизия
5bba2a2bd6
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4 2
      internal/ui/chat/messages_list.go

+ 4 - 2
internal/ui/chat/messages_list.go

@@ -3,7 +3,6 @@ package chat
 import (
 	"context"
 	"errors"
-	"github.com/ayn2op/tview/layers"
 	"io"
 	"log/slog"
 	"net/http"
@@ -14,6 +13,8 @@ import (
 	"sync"
 	"time"
 
+	"github.com/ayn2op/tview/layers"
+
 	"github.com/ayn2op/discordo/internal/clipboard"
 	"github.com/ayn2op/discordo/internal/config"
 	"github.com/ayn2op/discordo/internal/consts"
@@ -27,6 +28,7 @@ import (
 	"github.com/diamondburned/arikawa/v3/utils/json/option"
 	"github.com/diamondburned/ningen/v3/discordmd"
 	"github.com/gdamore/tcell/v3"
+	"github.com/gdamore/tcell/v3/color"
 	"github.com/skratchdot/open-golang/open"
 	"github.com/yuin/goldmark/ast"
 	"github.com/yuin/goldmark/parser"
@@ -160,7 +162,7 @@ func (ml *messagesList) writeMessage(builder *tview.LineBuilder, message discord
 	if ml.cfg.HideBlockedUsers {
 		isBlocked := ml.chatView.state.UserIsBlocked(message.Author.ID)
 		if isBlocked {
-			builder.Write("Blocked message", baseStyle.Foreground(tcell.ColorRed).Bold(true))
+			builder.Write("Blocked message", baseStyle.Foreground(color.Red).Bold(true))
 			return
 		}
 	}