Re-add ui-version to keep browser resource cache in service-worker

This commit is contained in:
Eike Kettner 2021-03-10 23:14:35 +01:00
parent a4a84abae5
commit 1a188afbd7
2 changed files with 8 additions and 5 deletions

View File

@ -18,11 +18,12 @@ case class Flags(
fullTextSearchEnabled: Boolean, fullTextSearchEnabled: Boolean,
maxPageSize: Int, maxPageSize: Int,
maxNoteLength: Int, maxNoteLength: Int,
showClassificationSettings: Boolean showClassificationSettings: Boolean,
uiVersion: Int
) )
object Flags { object Flags {
def apply(cfg: Config): Flags = def apply(cfg: Config, uiVersion: Int): Flags =
Flags( Flags(
cfg.appName, cfg.appName,
getBaseUrl(cfg), getBaseUrl(cfg),
@ -32,7 +33,8 @@ object Flags {
cfg.fullTextSearch.enabled, cfg.fullTextSearch.enabled,
cfg.maxItemPageSize, cfg.maxItemPageSize,
cfg.maxNoteLength, cfg.maxNoteLength,
cfg.showClassificationSettings cfg.showClassificationSettings,
uiVersion
) )
private def getBaseUrl(cfg: Config): String = private def getBaseUrl(cfg: Config): String =

View File

@ -133,10 +133,11 @@ object TemplateRoutes {
) )
object IndexData { object IndexData {
private[this] val uiVersion = 2
def apply(cfg: Config): IndexData = def apply(cfg: Config): IndexData =
IndexData( IndexData(
Flags(cfg), Flags(cfg, uiVersion),
chooseUi, chooseUi,
Seq( Seq(
"/app/assets" + Webjars.clipboardjs + "/clipboard.min.js", "/app/assets" + Webjars.clipboardjs + "/clipboard.min.js",
@ -145,7 +146,7 @@ object TemplateRoutes {
), ),
s"/app/assets/docspell-webapp/${BuildInfo.version}/favicon", s"/app/assets/docspell-webapp/${BuildInfo.version}/favicon",
s"/app/assets/docspell-webapp/${BuildInfo.version}/docspell.js", s"/app/assets/docspell-webapp/${BuildInfo.version}/docspell.js",
Flags(cfg).asJson.spaces2 Flags(cfg, uiVersion).asJson.spaces2
) )
private def chooseUi: Seq[String] = private def chooseUi: Seq[String] =