Simplify KeePassGO desktop vault workflow

This commit is contained in:
Joe Julian
2026-03-29 14:50:33 -07:00
parent 62fc343ecf
commit 4a629c16bd
6 changed files with 777 additions and 281 deletions
+19
View File
@@ -48,6 +48,11 @@ type SaveableSession interface {
Save() error
}
type SynchronizableSession interface {
CurrentSession
Synchronize() error
}
type CreateableSession interface {
CurrentSession
Create(vault.Model, vault.MasterKey) error
@@ -510,6 +515,20 @@ func (s *State) Save() error {
return nil
}
func (s *State) Synchronize() error {
session, ok := s.Session.(SynchronizableSession)
if !ok {
return fmt.Errorf("session is not synchronizable")
}
if err := session.Synchronize(); err != nil {
return err
}
s.Dirty = false
return nil
}
func (s *State) CreateVault(key vault.MasterKey) error {
session, ok := s.Session.(CreateableSession)
if !ok {