Skip to content

Commit

Permalink
Safeguard against long names
Browse files Browse the repository at this point in the history
Just truncate station name at 120/100 chars - I don't think any frontend want to display 250 characters long station name, on mobile.
  • Loading branch information
JabLuszko committed Sep 21, 2024
1 parent d3f75f2 commit d91185b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mapadroid/db/DbPogoProtoSubmitRaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ async def stations(self, session: AsyncSession, received_timestamp: int,
station_obj.id = station_id
station_obj.lat = latitude
station_obj.lon = longitude
station_obj.name = name
station_obj.name = name if len(name) < 120 else name[:100]+"..."

if station.battle_details and station.battle_details.battle_window_end_ms > 0:
bdetails: pogoprotos.BreadBattleDetailProto = station.battle_details
Expand Down

0 comments on commit d91185b

Please sign in to comment.