From cb3b7ba702255b0eda51fba42c8b0628cebaa03b Mon Sep 17 00:00:00 2001 From: Syphax Date: Mon, 5 Aug 2024 14:19:48 +0200 Subject: [PATCH] fix not saving the current url context when changing the language --- app/javascript/controllers/turbo_frame_controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/javascript/controllers/turbo_frame_controller.js b/app/javascript/controllers/turbo_frame_controller.js index 41c67dd5d..86ab789d7 100644 --- a/app/javascript/controllers/turbo_frame_controller.js +++ b/app/javascript/controllers/turbo_frame_controller.js @@ -24,7 +24,9 @@ export default class extends Controller { this.frame.innerHTML = this.placeHolderValue } else { this.frame.innerHTML = "" - this.urlValue = new HistoryService().getUpdatedURL(this.urlValue, data) + + let currentUrl = document.location.pathname + document.location.search + this.urlValue = new HistoryService().getUpdatedURL(currentUrl, data) this.frame.src = this.urlValue } }