diff options
author | Santo Cariotti <santo@dcariotti.me> | 2025-04-05 17:10:17 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2025-04-05 17:10:17 +0200 |
commit | d304cffee2f45361ef527181b74bfc1b2a670115 (patch) | |
tree | 53c32f45a5b18126b0bf1e1f7a76b1d0f6b41497 | |
parent | de0cae741138cde6c0444455fc4863a59b70470f (diff) |
Start with play model if already logged
-rw-r--r-- | ui/views/views.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ui/views/views.go b/ui/views/views.go index 2ce7eaa..f830687 100644 --- a/ui/views/views.go +++ b/ui/views/views.go @@ -1,6 +1,7 @@ package views import ( + "errors" "os" "os/exec" @@ -60,10 +61,16 @@ func NewRahannaModel() RahannaModel { auth := NewAuthModel(width, height) play := NewPlayModel(width, height) + var currentModel tea.Model = auth + + if _, err := os.Stat(".rahannarc"); !errors.Is(err, os.ErrNotExist) { + currentModel = play + } + return RahannaModel{ width: width, height: height, - currentModel: auth, + currentModel: currentModel, auth: auth, play: play, } |