Normalize vault storage root on open and create
This commit is contained in:
@@ -101,6 +101,10 @@ type RemoteOpenableSession interface {
|
||||
OpenRemote(webdav.Client, string, vault.MasterKey) error
|
||||
}
|
||||
|
||||
type WarningSession interface {
|
||||
ConsumeWarning() string
|
||||
}
|
||||
|
||||
type SecurityConfigurableSession interface {
|
||||
ConfigureSecurity(vault.SecuritySettings) error
|
||||
SecuritySettings() vault.SecuritySettings
|
||||
@@ -841,7 +845,13 @@ func (s *State) Unlock(key vault.MasterKey) error {
|
||||
return fmt.Errorf("session is not lockable")
|
||||
}
|
||||
|
||||
return session.Unlock(key)
|
||||
if err := session.Unlock(key); err != nil {
|
||||
return err
|
||||
}
|
||||
if warningSession, ok := s.Session.(WarningSession); ok {
|
||||
s.StatusMessage = warningSession.ConsumeWarning()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *State) ChangeMasterKey(key vault.MasterKey) error {
|
||||
@@ -1003,6 +1013,9 @@ func (s *State) OpenVault(path string, key vault.MasterKey) error {
|
||||
s.CurrentPath = nil
|
||||
s.SelectedEntryID = ""
|
||||
s.Dirty = false
|
||||
if warningSession, ok := s.Session.(WarningSession); ok {
|
||||
s.StatusMessage = warningSession.ConsumeWarning()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1033,6 +1046,9 @@ func (s *State) OpenRemoteVault(client webdav.Client, path string, key vault.Mas
|
||||
s.CurrentPath = nil
|
||||
s.SelectedEntryID = ""
|
||||
s.Dirty = false
|
||||
if warningSession, ok := s.Session.(WarningSession); ok {
|
||||
s.StatusMessage = warningSession.ConsumeWarning()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user