fix: incorrect page title when 'hls__' is opened (#8697)

* dev: move 'hls-file?' to pdf-utils
* dev: use 'hls-file?' instead of string comparison
* fix: window title when hls file opened
This commit is contained in:
Adam
2023-02-28 10:10:33 +03:00
committed by GitHub
parent 6108aa1036
commit 6f45107408
5 changed files with 11 additions and 10 deletions

View File

@@ -10,6 +10,7 @@
[frontend.handler.ui :as ui-handler]
[frontend.state :as state]
[frontend.util :as util]
[frontend.extensions.pdf.utils :as pdf-utils]
[logseq.graph-parser.text :as text]
[reitit.frontend.easy :as rfe]
[frontend.context.i18n :refer [t]]))
@@ -143,8 +144,9 @@
(defn update-page-title!
[route]
(let [{:keys [data path-params]} route
title (get-title (:name data) path-params)]
(util/set-title! title)))
title (get-title (:name data) path-params)
hls? (pdf-utils/hls-file? title)]
(util/set-title! (if hls? (pdf-utils/fix-local-asset-pagename title) title))))
(defn update-page-label!
[route]