Merge pull request 'Optimistically Sync Servers on Import Bundle' (#45) from ui-fixes into trunk
continuous-integration/drone/push Build is passing Details

Reviewed-on: #45
This commit is contained in:
Dan Ballard 2021-05-31 16:30:47 -07:00
commit 4f625c7f8e
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()}))