mirror of
https://github.com/hassio-addons/addon-grocy.git
synced 2025-05-04 19:21:24 +00:00
19 lines
898 B
Diff
19 lines
898 B
Diff
diff --git a/views/layout/default.blade.php b/views/layout/default.blade.php
|
|
index fceaaa0..bfc76e6 100644
|
|
--- a/views/layout/default.blade.php
|
|
+++ b/views/layout/default.blade.php
|
|
@@ -87,7 +87,7 @@
|
|
Grocy.Components = { };
|
|
Grocy.Mode = '{{ GROCY_MODE }}';
|
|
- Grocy.BaseUrl = '{{ $U('/') }}';
|
|
- Grocy.CurrentUrlRelative = "/" + window.location.href.split('?')[0].replace(Grocy.BaseUrl, "");
|
|
+ if('{{ $U('/') }}'.includes('http')) {
|
|
+ Grocy.BaseUrl = '{{ $U('/') }}';
|
|
+ Grocy.CurrentUrlRelative = "/" + window.location.href.split('?')[0].replace(Grocy.BaseUrl, "");
|
|
+ } else {
|
|
+ Grocy.BaseUrl = window.location.origin + '{{ $U('/') }}';
|
|
+ Grocy.CurrentUrlRelative = "/" + window.location.pathname.replace((new URL(Grocy.BaseUrl)).pathname, "");
|
|
+ }
|
|
Grocy.ActiveNav = '@yield('activeNav', '')';
|
|
Grocy.Culture = '{{ GROCY_LOCALE }}';
|
|
Grocy.Currency = '{{ GROCY_CURRENCY }}';
|