@@ -3,30 +3,10 @@ import { MapContainer, TileLayer, Marker, Popup } from "react-leaflet";
33import { LatLng , DivIcon } from "leaflet" ;
44import "leaflet/dist/leaflet.css" ;
55import init , { parse_seed , parse_notarized , parse_finalized } from "./alto_types/alto_types.js" ;
6- import { WS_URL , PUBLIC_KEY } from "./config" ;
6+ import { WS_URL , PUBLIC_KEY , LOCATIONS } from "./config" ;
77import { SeedJs , NotarizedJs , FinalizedJs , BlockJs } from "./types" ;
88import "./App.css" ;
99
10- // Array of locations for deterministic mapping
11- const locations : [ number , number ] [ ] = [
12- [ 37.7749 , - 122.4194 ] , // San Francisco
13- [ 51.5074 , - 0.1278 ] , // London
14- [ 35.6895 , 139.6917 ] , // Tokyo
15- [ - 33.8688 , 151.2093 ] , // Sydney
16- [ 55.7558 , 37.6173 ] , // Moscow
17- [ - 23.5505 , - 46.6333 ] , // Sao Paulo
18- [ 28.6139 , 77.2090 ] , // New Delhi
19- [ 40.7128 , - 74.0060 ] , // New York
20- [ 19.4326 , - 99.1332 ] , // Mexico City
21- [ 31.2304 , 121.4737 ] , // Shanghai
22- ] ;
23-
24- // Location names for popups
25- const locationNames : string [ ] = [
26- "San Francisco" , "London" , "Tokyo" , "Sydney" , "Moscow" ,
27- "Sao Paulo" , "New Delhi" , "New York" , "Mexico City" , "Shanghai"
28- ] ;
29-
3010type ViewStatus = "growing" | "notarized" | "finalized" | "timed_out" ;
3111
3212interface ViewData {
@@ -220,7 +200,7 @@ const App: React.FC = () => {
220200
221201 // Add any missed views as skipped/timed out
222202 for ( let missedView = startViewIndex ; missedView < view ; missedView ++ ) {
223- const locationIndex = missedView % locations . length ;
203+ const locationIndex = missedView % LOCATIONS . length ;
224204
225205 // Check if this view already exists
226206 const existingIndex = newViews . findIndex ( v => v . view === missedView ) ;
@@ -229,8 +209,8 @@ const App: React.FC = () => {
229209 // Only add if it doesn't already exist
230210 newViews . unshift ( {
231211 view : missedView ,
232- location : locations [ locationIndex ] ,
233- locationName : locationNames [ locationIndex ] ,
212+ location : LOCATIONS [ locationIndex ] [ 0 ] ,
213+ locationName : LOCATIONS [ locationIndex ] [ 1 ] ,
234214 status : "timed_out" ,
235215 startTime : Date . now ( ) ,
236216 } ) ;
@@ -255,11 +235,11 @@ const App: React.FC = () => {
255235 }
256236
257237 // Create the new view data
258- const locationIndex = view % locations . length ;
238+ const locationIndex = view % LOCATIONS . length ;
259239 const newView : ViewData = {
260240 view,
261- location : locations [ locationIndex ] ,
262- locationName : locationNames [ locationIndex ] ,
241+ location : LOCATIONS [ locationIndex ] [ 0 ] ,
242+ locationName : LOCATIONS [ locationIndex ] [ 1 ] ,
263243 status : "growing" ,
264244 startTime : Date . now ( ) ,
265245 signature : seed . signature ,
@@ -336,11 +316,11 @@ const App: React.FC = () => {
336316 }
337317
338318 // If view doesn't exist, create it
339- const locationIndex = view % locations . length ;
319+ const locationIndex = view % LOCATIONS . length ;
340320 return [ {
341321 view,
342- location : locations [ locationIndex ] ,
343- locationName : locationNames [ locationIndex ] ,
322+ location : LOCATIONS [ locationIndex ] [ 0 ] ,
323+ locationName : LOCATIONS [ locationIndex ] [ 1 ] ,
344324 status : "notarized" ,
345325 startTime : Date . now ( ) ,
346326 notarizationTime : Date . now ( ) ,
@@ -381,11 +361,11 @@ const App: React.FC = () => {
381361 }
382362
383363 // If view doesn't exist, create it
384- const locationIndex = view % locations . length ;
364+ const locationIndex = view % LOCATIONS . length ;
385365 return [ {
386366 view,
387- location : locations [ locationIndex ] ,
388- locationName : locationNames [ locationIndex ] ,
367+ location : LOCATIONS [ locationIndex ] [ 0 ] ,
368+ locationName : LOCATIONS [ locationIndex ] [ 1 ] ,
389369 status : "finalized" ,
390370 startTime : Date . now ( ) ,
391371 finalizationTime : Date . now ( ) ,
0 commit comments