summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-04-05 17:10:17 +0200
committerSanto Cariotti <santo@dcariotti.me>2025-04-05 17:10:17 +0200
commitd304cffee2f45361ef527181b74bfc1b2a670115 (patch)
tree53c32f45a5b18126b0bf1e1f7a76b1d0f6b41497
parentde0cae741138cde6c0444455fc4863a59b70470f (diff)
Start with play model if already logged
-rw-r--r--ui/views/views.go9
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,
}