Skip to content

Commit

Permalink
Auto-fetch saved profiles from vehicle on cold boots
Browse files Browse the repository at this point in the history
This way, if someone has already saved it's profiles in the vehicle using a topside computer, it will auto-download the same profiles on new computers.
  • Loading branch information
rafaellehmkuhl authored and patrickelectric committed Nov 20, 2023
1 parent cdddc60 commit 9f05d86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/stores/widgetManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,9 @@ export const useWidgetManagerStore = defineStore('widget-manager', () => {
}
}

// If the user does not have it's own profiles yet, create them
// If the user does not have it's own profiles yet, try to fetch them from the vehicle, and if it fails, create default ones
if (savedProfiles.value.isEmpty()) {
importProfilesFromVehicle()
widgetProfiles.forEach((profile) => {
// @ts-ignore: structuredClone is a thing since a long time ago
const userProfile = structuredClone(profile)
Expand Down

0 comments on commit 9f05d86

Please sign in to comment.