Optimistically Sync Servers on Import Bundle #45

Merged
dan merged 1 commits from ui-fixes into trunk 2021-05-31 23:30:48 +00:00
1 changed files with 6 additions and 0 deletions

6
lib.go
View File

@ -630,6 +630,12 @@ func ImportBundle(profileOnion string, bundle string) {
if err == nil {
response = groupHandler.HandleImportString(profile, bundle)
eventHandler.Push(event.NewEvent(event.AppError, map[event.Field]string{event.Data: response.Error()}))
// We might have added a new server, so refresh the server list...
serverListForOnion := groupHandler.GetServerInfoList(profile)
serversListBytes, _ := json.Marshal(serverListForOnion)
eventHandler.Push(event.NewEvent(groups.UpdateServerInfo, map[event.Field]string{"ProfileOnion": profileOnion, groups.ServerList: string(serversListBytes)}))
}
}
eventHandler.Push(event.NewEvent(event.AppError, map[event.Field]string{event.Data: response.Error()}))