From 9f05d8627e9cfbafee3e4319d687bbfde41159a2 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Thu, 16 Nov 2023 18:57:21 -0300 Subject: [PATCH] Auto-fetch saved profiles from vehicle on cold boots 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. --- src/stores/widgetManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stores/widgetManager.ts b/src/stores/widgetManager.ts index 4d77e391b..7c9262b1c 100644 --- a/src/stores/widgetManager.ts +++ b/src/stores/widgetManager.ts @@ -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)