From cccad5a797230d60ce01d6ea52df327c29dd3cbb Mon Sep 17 00:00:00 2001 From: ztimson Date: Mon, 2 Sep 2019 18:08:10 -0400 Subject: [PATCH] Save client names --- src/app/views/map/map.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/views/map/map.component.ts b/src/app/views/map/map.component.ts index a2997a8..2e7b520 100644 --- a/src/app/views/map/map.component.ts +++ b/src/app/views/map/map.component.ts @@ -38,7 +38,11 @@ export class MapComponent implements OnDestroy, OnInit { menu: ToolbarItem[]; constructor(public physicsService: PhysicsService, public syncService: SyncService, private snackBar: MatSnackBar, private bottomSheet: MatBottomSheet, private dialog: MatDialog, private route: ActivatedRoute) { - this.name = Adjectives[Math.floor(Math.random() * Adjectives.length)] + Nouns[Math.floor(Math.random() * Nouns.length)]; + this.name = localStorage.getItem('callSign'); + if(!this.name) { + this.name = Adjectives[Math.floor(Math.random() * Adjectives.length)] + Nouns[Math.floor(Math.random() * Nouns.length)]; + localStorage.setItem('callSign', this.name); + } this.menu = [ {name: 'Marker', icon: 'room', toggle: true, onEnabled: this.startMarker, onDisabled: this.unsub},