Fix Reloading changes on dark mode switch

This commit is contained in:
JonatanRek 2023-09-22 11:31:24 +02:00
parent 46e3b2ceb3
commit 57791c1466
2 changed files with 9 additions and 16 deletions

View File

@ -2,23 +2,16 @@
namespace BookStack\App;
use BookStack\Activity\ActivityQueries;
use BookStack\Entities\Models\Book;
use BookStack\Entities\Models\Page;
use BookStack\Entities\Queries\RecentlyViewed;
use BookStack\Entities\Queries\TopFavourites;
use BookStack\Entities\Repos\BookRepo;
use BookStack\Entities\Repos\BookshelfRepo;
use BookStack\Entities\Tools\PageContent;
use BookStack\Http\Controller;
use BookStack\Uploads\FaviconHandler;
use BookStack\Util\SimpleListOptions;
use Illuminate\Http\Request;
class PwaManifestBuilder extends Controller
{
private function GenerateManifest()
{
dump(setting()->getForCurrentUser('dark-mode-enabled'));
dump(setting('app-color-dark'));
dump(setting('app-color'));
return [
"name" => setting('app-name'),
"short_name" => setting('app-name'),
@ -27,7 +20,7 @@ class PwaManifestBuilder extends Controller
"display" => "standalone",
"background_color" => (setting()->getForCurrentUser('dark-mode-enabled') ? setting('app-color-dark') : setting('app-color')),
"description" => setting('app-name'),
"theme_color" => setting('app-color'),
"theme_color" => (setting()->getForCurrentUser('dark-mode-enabled') ? setting('app-color-dark') : setting('app-color')),
"launch_handler" => [
"client_mode" => "focus-existing"
],
@ -59,12 +52,12 @@ class PwaManifestBuilder extends Controller
"type" => "image/png"
],
[
"src" => "icon.ico",
"src" => public_path('icon.ico'),
"sizes" => "48x48",
"type" => "image/vnd.microsoft.icon"
],
[
"src" => "favicon.ico",
"src" => public_path('favicon.ico'),
"sizes" => "48x48",
"type" => "image/vnd.microsoft.icon"
],

View File

@ -10,7 +10,7 @@
<meta name="viewport" content="width=device-width">
<meta name="token" content="{{ csrf_token() }}">
<meta name="base-url" content="{{ url('/') }}">
<meta name="theme-color" content="{{ setting('app-color') }}"/>
<meta name="theme-color" content="{{(setting()->getForCurrentUser('dark-mode-enabled') ? setting('app-color-dark') : setting('app-color'))}}"/>
<!-- Social Cards Meta -->
<meta property="og:title" content="{{ isset($pageTitle) ? $pageTitle . ' | ' : '' }}{{ setting('app-name') }}">
@ -31,7 +31,7 @@
<!-- PWA -->
<link rel="manifest" href="{{ url('/manifest.json') }}" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
@yield('head')