瀏覽代碼

Merge branch 'clifix' of cwtch.im/cwtch into master

pull/114/head
Dan Ballard 1 年之前
committed by Gogs
父節點
當前提交
f217533044
共有 1 個檔案被更改,包括 8 行新增5 行删除
  1. +8
    -5
      app/app.go

+ 8
- 5
app/app.go 查看文件

@@ -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 {


Loading…
取消
儲存