From d940665e9275db71f9a31513d17811bab2f1369a Mon Sep 17 00:00:00 2001 From: Zachary Knight Date: Sat, 24 Jul 2021 20:42:33 -0400 Subject: [PATCH] fixes relative URL --- grocy/rootfs/patches/fix_braindamage.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grocy/rootfs/patches/fix_braindamage.patch b/grocy/rootfs/patches/fix_braindamage.patch index f0c814c..bd76ccd 100644 --- a/grocy/rootfs/patches/fix_braindamage.patch +++ b/grocy/rootfs/patches/fix_braindamage.patch @@ -8,7 +8,7 @@ index fceaaa0..bfc76e6 100644 - Grocy.BaseUrl = '{{ $U('/') }}'; - Grocy.CurrentUrlRelative = "/" + window.location.href.split('?')[0].replace(Grocy.BaseUrl, ""); + Grocy.BaseUrl = window.location.origin + '{{ $U('/') }}'; -+ Grocy.CurrentUrlRelative = "/" + window.location.pathname.replace(Grocy.BaseUrl, ""); ++ Grocy.CurrentUrlRelative = "/" + window.location.pathname.replace((new URL(Grocy.BaseUrl)).pathname, ""); Grocy.ActiveNav = '@yield('activeNav', '')'; Grocy.Culture = '{{ GROCY_LOCALE }}'; Grocy.Currency = '{{ GROCY_CURRENCY }}';