mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 20:18:35 -07:00
Dont save setting files on load fail
This commit is contained in:
@@ -121,9 +121,7 @@ Bt* bt_alloc() {
|
||||
bt->max_packet_size = FURI_HAL_BT_SERIAL_PACKET_SIZE_MAX;
|
||||
bt->profile = BtProfileSerial;
|
||||
// Load settings
|
||||
if(!bt_settings_load(&bt->bt_settings)) {
|
||||
bt_settings_save(&bt->bt_settings);
|
||||
}
|
||||
bt_settings_load(&bt->bt_settings);
|
||||
// Keys storage
|
||||
bt->keys_storage = bt_keys_storage_alloc(BT_KEYS_STORAGE_PATH);
|
||||
// Alloc queue
|
||||
|
||||
@@ -457,10 +457,8 @@ int32_t desktop_srv(void* p) {
|
||||
|
||||
Desktop* desktop = desktop_alloc();
|
||||
|
||||
bool loaded = DESKTOP_SETTINGS_LOAD(&desktop->settings);
|
||||
if(!loaded) {
|
||||
if(!DESKTOP_SETTINGS_LOAD(&desktop->settings)) {
|
||||
memset(&desktop->settings, 0, sizeof(desktop->settings));
|
||||
DESKTOP_SETTINGS_SAVE(&desktop->settings);
|
||||
}
|
||||
|
||||
desktop_clock_toggle_view(desktop, desktop->settings.display_clock);
|
||||
|
||||
@@ -497,11 +497,7 @@ int32_t notification_srv(void* p) {
|
||||
UNUSED(p);
|
||||
NotificationApp* app = notification_app_alloc();
|
||||
|
||||
if(furi_hal_is_normal_boot()) {
|
||||
if(!notification_load_settings(app)) {
|
||||
notification_save_settings(app);
|
||||
}
|
||||
}
|
||||
notification_load_settings(app);
|
||||
|
||||
notification_vibro_off();
|
||||
notification_sound_off();
|
||||
|
||||
@@ -509,7 +509,6 @@ int32_t power_srv(void* p) {
|
||||
Power* power = power_alloc();
|
||||
if(!LOAD_POWER_SETTINGS(&power->shutdown_idle_delay_ms)) {
|
||||
power->shutdown_idle_delay_ms = 0;
|
||||
SAVE_POWER_SETTINGS(&power->shutdown_idle_delay_ms);
|
||||
}
|
||||
power_auto_shutdown_arm(power);
|
||||
power_update_info(power);
|
||||
|
||||
Reference in New Issue
Block a user