Skip to content

Commit

Permalink
Fix deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniomika committed Nov 8, 2023
1 parent efd5af1 commit 0e7eac3
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ require (
github.com/yusufpapurcu/wmi v1.2.3 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/term v0.14.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
4 changes: 2 additions & 2 deletions pgs/cms.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var (
)

func NewSpinner() spinner.Model {
s := spinner.NewModel()
s := spinner.New()
s.Spinner = spinner.Dot
s.Style = spinnerStyle
return s
Expand Down Expand Up @@ -154,7 +154,7 @@ type model struct {
}

func (m model) Init() tea.Cmd {
return spinner.Tick
return m.spinner.Tick
}

func (m model) findUser() (*db.User, error) {
Expand Down
4 changes: 2 additions & 2 deletions wish/cms/cms.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ var (
)

func NewSpinner() spinner.Model {
s := spinner.NewModel()
s := spinner.New()
s.Spinner = spinner.Dot
s.Style = spinnerStyle
return s
Expand Down Expand Up @@ -165,7 +165,7 @@ type model struct {
}

func (m model) Init() tea.Cmd {
return spinner.Tick
return m.spinner.Tick
}

func (m model) findUser() (*db.User, error) {
Expand Down
6 changes: 3 additions & 3 deletions wish/cms/ui/account/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ func (m *CreateModel) indexBackward() {
func NewCreateModel(cfg *config.ConfigCms, dbpool db.DB, publicKey string) CreateModel {
st := common.DefaultStyles()

im := input.NewModel()
im.CursorStyle = st.Cursor
im := input.New()
im.Cursor.Style = st.Cursor
im.Placeholder = "erock"
im.Prompt = st.FocusedPrompt.String()
im.CharLimit = 50
Expand Down Expand Up @@ -176,7 +176,7 @@ func Update(msg tea.Msg, m CreateModel) (CreateModel, tea.Cmd) {

return m, tea.Batch(
createAccount(m), // fire off the command, too
spinner.Tick,
m.spinner.Tick,
)
case cancelButton: // Exit
m.Quit = true
Expand Down
2 changes: 1 addition & 1 deletion wish/cms/ui/common/views.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func KeyValueView(stuff ...string) string {

// NewSpinner returns a spinner model.
func NewSpinner() spinner.Model {
s := spinner.NewModel()
s := spinner.New()
s.Spinner = spinner.Dot
s.Style = spinnerStyle
return s
Expand Down
6 changes: 3 additions & 3 deletions wish/cms/ui/createkey/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ func (m *Model) indexBackward() {
func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
st := common.DefaultStyles()

im := input.NewModel()
im.CursorStyle = st.Cursor
im := input.New()
im.Cursor.Style = st.Cursor
im.Placeholder = "ssh-ed25519 AAAA..."
im.Prompt = st.FocusedPrompt.String()
im.CharLimit = 2049
Expand Down Expand Up @@ -164,7 +164,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

return m, tea.Batch(
addPublicKey(m), // fire off the command, too
spinner.Tick,
m.spinner.Tick,
)
case cancelButton: // Exit this mini-app
m.Done = true
Expand Down
6 changes: 3 additions & 3 deletions wish/cms/ui/createtoken/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func (m *Model) indexBackward() {
func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
st := common.DefaultStyles()

im := input.NewModel()
im.CursorStyle = st.Cursor
im := input.New()
im.Cursor.Style = st.Cursor
im.Placeholder = "A name used for your reference"
im.Prompt = st.FocusedPrompt.String()
im.CharLimit = 256
Expand Down Expand Up @@ -176,7 +176,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

return m, tea.Batch(
addToken(m), // fire off the command, too
spinner.Tick,
m.spinner.Tick,
)
case cancelButton: // Exit this mini-app
m.Done = true
Expand Down
6 changes: 3 additions & 3 deletions wish/cms/ui/keys/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (m *Model) UpdatePaging(msg tea.Msg) {
func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
st := common.DefaultStyles()

p := pager.NewModel()
p := pager.New()
p.PerPage = keysPerPage
p.Type = pager.Dots
p.InactiveDot = st.InactivePagination.Render("•")
Expand All @@ -110,7 +110,7 @@ func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
// Init is the Tea initialization function.
func (m Model) Init() tea.Cmd {
return tea.Batch(
spinner.Tick,
m.spinner.Tick,
)
}

Expand Down Expand Up @@ -381,7 +381,7 @@ func (m Model) promptView(prompt string) string {
func LoadKeys(m Model) tea.Cmd {
return tea.Batch(
fetchKeys(m.dbpool, m.user),
spinner.Tick,
m.spinner.Tick,
)
}

Expand Down
6 changes: 3 additions & 3 deletions wish/cms/ui/posts/posts.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func NewModel(cfg *config.ConfigCms, urls config.ConfigURL, dbpool db.DB, user *
logger := cfg.Logger
st := common.DefaultStyles()

p := pager.NewModel()
p := pager.New()
p.PerPage = keysPerPage
p.Type = pager.Dots
p.InactiveDot = st.InactivePagination.Render("•")
Expand All @@ -115,7 +115,7 @@ func NewModel(cfg *config.ConfigCms, urls config.ConfigURL, dbpool db.DB, user *
// Init is the Tea initialization function.
func (m Model) Init() tea.Cmd {
return tea.Batch(
spinner.Tick,
m.spinner.Tick,
)
}

Expand Down Expand Up @@ -315,7 +315,7 @@ func LoadPosts(m Model) tea.Cmd {

return tea.Batch(
m.fetchPosts(m.user.ID),
spinner.Tick,
m.spinner.Tick,
)
}

Expand Down
6 changes: 3 additions & 3 deletions wish/cms/ui/tokens/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (m *Model) UpdatePaging(msg tea.Msg) {
func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
st := common.DefaultStyles()

p := pager.NewModel()
p := pager.New()
p.PerPage = keysPerPage
p.Type = pager.Dots
p.InactiveDot = st.InactivePagination.Render("•")
Expand All @@ -108,7 +108,7 @@ func NewModel(cfg *config.ConfigCms, dbpool db.DB, user *db.User) Model {
// Init is the Tea initialization function.
func (m Model) Init() tea.Cmd {
return tea.Batch(
spinner.Tick,
m.spinner.Tick,
)
}

Expand Down Expand Up @@ -349,7 +349,7 @@ func (m Model) promptView(prompt string) string {
func LoadKeys(m Model) tea.Cmd {
return tea.Batch(
fetchKeys(m.dbpool, m.user),
spinner.Tick,
m.spinner.Tick,
)
}

Expand Down
6 changes: 3 additions & 3 deletions wish/cms/ui/username/username.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ func (m *Model) indexBackward() {
func NewModel(dbpool db.DB, user *db.User, sshUser string) Model {
st := common.DefaultStyles()

im := input.NewModel()
im.CursorStyle = st.Cursor
im := input.New()
im.Cursor.Style = st.Cursor
im.Placeholder = sshUser
im.Prompt = st.FocusedPrompt.String()
im.CharLimit = 50
Expand Down Expand Up @@ -178,7 +178,7 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {

return m, tea.Batch(
setName(m), // fire off the command, too
spinner.Tick,
m.spinner.Tick,
)
case cancelButton: // Exit this mini-app
m.Done = true
Expand Down

0 comments on commit 0e7eac3

Please sign in to comment.