X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/f6d3944b20cc208341518e0d6190a46f33b5588c..refs/pull/5721/head:/app/Settings/AppSettingsStore.php diff --git a/app/Settings/AppSettingsStore.php b/app/Settings/AppSettingsStore.php index 8d7b73c1c..e6fc466ba 100644 --- a/app/Settings/AppSettingsStore.php +++ b/app/Settings/AppSettingsStore.php @@ -2,16 +2,16 @@ namespace BookStack\Settings; +use BookStack\Uploads\FaviconHandler; use BookStack\Uploads\ImageRepo; use Illuminate\Http\Request; class AppSettingsStore { - protected ImageRepo $imageRepo; - - public function __construct(ImageRepo $imageRepo) - { - $this->imageRepo = $imageRepo; + public function __construct( + protected ImageRepo $imageRepo, + protected FaviconHandler $faviconHandler, + ) { } public function storeFromUpdateRequest(Request $request, string $category) @@ -39,6 +39,8 @@ class AppSettingsStore $icon = $this->imageRepo->saveNew($iconFile, 'system', 0, $size, $size); setting()->put('app-icon-' . $size, $icon->url); } + + $this->faviconHandler->saveForUploadedImage($iconFile); } // Clear icon image if requested @@ -49,6 +51,8 @@ class AppSettingsStore $this->destroyExistingSettingImage('app-icon-' . $size); setting()->remove('app-icon-' . $size); } + + $this->faviconHandler->restoreOriginal(); } }