feat(app): add location read scope and update map angle calculations

This commit is contained in:
2025-08-09 21:17:23 +02:00
parent fb3ebc10ff
commit 91cbb6c841
2 changed files with 24 additions and 19 deletions

13
app.go
View File

@@ -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)
}