feat(app): add location read scope and update map angle calculations
This commit is contained in:
13
app.go
13
app.go
@@ -35,7 +35,8 @@ func (a *App) startup(ctx context.Context) {
|
||||
redirectURI = "http://localhost:8080/callback"
|
||||
}
|
||||
|
||||
a.ssi = NewESISSO(clientID, redirectURI, []string{"esi-ui.write_waypoint.v1"})
|
||||
// Add location read scope so we can fetch character locations
|
||||
a.ssi = NewESISSO(clientID, redirectURI, []string{"esi-ui.write_waypoint.v1", "esi-location.read_location.v1"})
|
||||
}
|
||||
|
||||
// Greet returns a greeting for the given name
|
||||
@@ -130,8 +131,10 @@ func (a *App) ListCharacters() ([]CharacterInfo, error) {
|
||||
|
||||
// GetCharacterLocations exposes current locations for all characters
|
||||
func (a *App) GetCharacterLocations() ([]CharacterLocation, error) {
|
||||
if a.ssi == nil { return nil, errors.New("ESI not initialised") }
|
||||
ctx, cancel := context.WithTimeout(a.ctx, 6*time.Second)
|
||||
defer cancel()
|
||||
return a.ssi.GetCharacterLocations(ctx)
|
||||
if a.ssi == nil {
|
||||
return nil, errors.New("ESI not initialised")
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(a.ctx, 6*time.Second)
|
||||
defer cancel()
|
||||
return a.ssi.GetCharacterLocations(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user