From b1f594986821e06293b25cfc9e664a78e39ad936 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Mon, 5 Aug 2019 15:00:41 -0300 Subject: [PATCH] FIX: Make the workbox path compatible with multisite Closes https://meta.discourse.org/t/full-url-in-assets-erb-file-multisite-issues/124393?u=falco --- app/assets/javascripts/service-worker.js.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/service-worker.js.erb b/app/assets/javascripts/service-worker.js.erb index ecc892334b2..fcc710d62bc 100644 --- a/app/assets/javascripts/service-worker.js.erb +++ b/app/assets/javascripts/service-worker.js.erb @@ -1,9 +1,9 @@ 'use strict'; -importScripts("<%= ::UrlHelper.absolute("/javascripts/workbox/workbox-sw.js") %>"); +importScripts("<%= "#{Discourse.asset_host}#{Discourse.base_path}/javascripts/workbox/workbox-sw.js") %>"); workbox.setConfig({ - modulePathPrefix: "<%= ::UrlHelper.absolute("/javascripts/workbox") %>", + modulePathPrefix: "<%= "#{Discourse.asset_host}#{Discourse.base_path}/javascripts/workbox") %>", debug: false });