mirror of
https://github.com/penpot/penpot.git
synced 2025-05-22 10:16:10 +02:00
🐛 Show proper 404 when look on not-existing page on viewer.
This commit is contained in:
parent
9ecbddc18c
commit
f3bb5c55f5
2 changed files with 19 additions and 13 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
(ns app.main.ui.viewer
|
||||
(:require
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.geom.point :as gpt]
|
||||
[app.main.data.comments :as dcm]
|
||||
[app.main.data.viewer :as dv]
|
||||
|
@ -38,14 +39,10 @@
|
|||
[{:keys [params data]}]
|
||||
|
||||
(let [{:keys [page-id section index]} params
|
||||
{:keys [file users project perms]} data
|
||||
|
||||
local (mf/deref refs/viewer-local)
|
||||
|
||||
file (:file data)
|
||||
users (:users data)
|
||||
project (:project data)
|
||||
perms (:permissions data)
|
||||
|
||||
page-id (or page-id (-> file :data :pages first))
|
||||
|
||||
page (mf/use-memo
|
||||
|
@ -78,6 +75,9 @@
|
|||
|
||||
(hooks/use-shortcuts ::viewer sc/shortcuts)
|
||||
|
||||
(when (nil? page)
|
||||
(ex/raise :type :not-found))
|
||||
|
||||
;; Set the page title
|
||||
(mf/use-effect
|
||||
(mf/deps (:name file))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue