Refactor naming of tracked trip to leg
This commit is contained in:
@@ -55,25 +55,25 @@ export class RecentLocationsDataStore {
|
||||
}
|
||||
}
|
||||
|
||||
export class TrackedTripsDataStore {
|
||||
export class LegsDataStore {
|
||||
constructor() {
|
||||
this.data = [];
|
||||
this.read();
|
||||
}
|
||||
|
||||
read() {
|
||||
this.data = DataStore.get("tracked-trips") || [];
|
||||
this.data = DataStore.get("legs") || [];
|
||||
}
|
||||
|
||||
write() {
|
||||
DataStore.set("tracked-trips", this.data);
|
||||
DataStore.set("legs", this.data);
|
||||
}
|
||||
|
||||
remember(trip_id, origin_id, destination_id) {
|
||||
this.data.push({
|
||||
trip: trip_id,
|
||||
origin: origin_id,
|
||||
destination: destination_id,
|
||||
trip_id: trip_id,
|
||||
origin_location_id: origin_id,
|
||||
destination_location_id: destination_id,
|
||||
});
|
||||
|
||||
this.write();
|
||||
@@ -119,7 +119,7 @@ export class DataStore {
|
||||
constructor() {
|
||||
this.locations = new LocationsDataStore();
|
||||
this.recent_locations = new RecentLocationsDataStore();
|
||||
this.tracked_trips = new TrackedTripsDataStore();
|
||||
this.legs = new LegsDataStore();
|
||||
this.trips = new TripsDataStore();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user