Quick fix for #107 #108
|
@ -70,6 +70,7 @@ 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 {
|
||||
if app.Peer == nil {
|
||||
profile, err := peer.LoadCwtchPeer(path.Join(app.directory, filename), password)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -77,6 +78,8 @@ func (app *Application) SetProfile(filename string, password string) error {
|
|||
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 {
|
||||
go func() {
|
||||
|
|
Loading…
Reference in New Issue