원본 프로젝트 : cwtch.im/cwtch
1
0
포크 0
This commit is contained in:
Sarah Jamie Lewis 2018-08-05 09:01:00 -07:00
부모 a459758070
커밋 7ae8e8d8ee
1개의 변경된 파일8개의 추가작업 그리고 5개의 파일을 삭제

파일 보기

@ -70,12 +70,15 @@ func (app *Application) startTor(torPath string) error {
// SetProfile loads an existing profile from the given filename.
func (app *Application) SetProfile(filename string, password string) error {
profile, err := peer.LoadCwtchPeer(path.Join(app.directory, filename), password)
if err != nil {
return err
if app.Peer == nil {
profile, err := peer.LoadCwtchPeer(path.Join(app.directory, filename), password)
if err != nil {
return err
}
app.Peer = profile
return app.startPeer()
}
app.Peer = profile
return app.startPeer()
return errors.New("profile is already loaded, to load a different profile you will need to restart the application")
}
func (app *Application) startPeer() error {