mirror of
https://github.com/penpot/penpot.git
synced 2025-06-01 04:51:37 +02:00
🐛 Fix new-file button on project not redirecting to the new file
This commit is contained in:
parent
5631204567
commit
872648d393
2 changed files with 14 additions and 2 deletions
|
@ -71,6 +71,7 @@
|
||||||
- Fix error screen on upload image error [Taiga #5608](https://tree.taiga.io/project/penpot/issue/5608)
|
- Fix error screen on upload image error [Taiga #5608](https://tree.taiga.io/project/penpot/issue/5608)
|
||||||
- Fix bad frame-id for certain componentes [#3205](https://github.com/penpot/penpot/issues/3205)
|
- Fix bad frame-id for certain componentes [#3205](https://github.com/penpot/penpot/issues/3205)
|
||||||
- Fix paste elements at bottom of frame [Taig #5253](https://tree.taiga.io/project/penpot/issue/5253)
|
- Fix paste elements at bottom of frame [Taig #5253](https://tree.taiga.io/project/penpot/issue/5253)
|
||||||
|
- Fix new-file button on project not redirecting to the new file [Taiga #5610](https://tree.taiga.io/project/penpot/issue/5610)
|
||||||
|
|
||||||
### :arrow_up: Deps updates
|
### :arrow_up: Deps updates
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
|
[app.util.router :as rt]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[beicon.core :as rx]
|
[beicon.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
|
@ -142,12 +143,22 @@
|
||||||
(sort-by :modified-at)
|
(sort-by :modified-at)
|
||||||
(reverse)))
|
(reverse)))
|
||||||
|
|
||||||
|
on-file-created
|
||||||
|
(mf/use-fn
|
||||||
|
(fn [data]
|
||||||
|
(let [pparams {:project-id (:project-id data)
|
||||||
|
:file-id (:id data)}
|
||||||
|
qparams {:page-id (get-in data [:data :pages 0])}]
|
||||||
|
(st/emit! (rt/nav :workspace pparams qparams)))))
|
||||||
|
|
||||||
create-file
|
create-file
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps project)
|
(mf/deps project)
|
||||||
(fn [origin]
|
(fn [origin]
|
||||||
(st/emit! (with-meta (dd/create-file {:project-id (:id project)})
|
(let [mdata {:on-success on-file-created}
|
||||||
{::ev/origin origin}))))]
|
params {:project-id (:id project)}]
|
||||||
|
(st/emit! (-> (dd/create-file (with-meta params mdata))
|
||||||
|
(with-meta {::ev/origin origin}))))))]
|
||||||
|
|
||||||
(mf/with-effect []
|
(mf/with-effect []
|
||||||
(let [node (mf/ref-val rowref)
|
(let [node (mf/ref-val rowref)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue