From 23f65b9eb29c1581ca6dc7e615e3f43f4b9f8eb9 Mon Sep 17 00:00:00 2001 From: proddy Date: Tue, 20 Sep 2022 19:05:02 +0530 Subject: [PATCH] fixes does Factory Reset from the webUI work? #628 --- lib/framework/FactoryResetService.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/framework/FactoryResetService.cpp b/lib/framework/FactoryResetService.cpp index bcf1029e9..46a6443d8 100644 --- a/lib/framework/FactoryResetService.cpp +++ b/lib/framework/FactoryResetService.cpp @@ -25,9 +25,10 @@ void FactoryResetService::factoryReset() { File root = fs->open(FS_CONFIG_DIRECTORY); File file; while (file = root.openNextFile()) { - char * pathStr = strdup(file.name()); + String path = file.path(); file.close(); - fs->remove(pathStr); + fs->remove(path); } + RestartService::restartNow(); }