From f2454c5d13a1f027901964e34fdcb0b3497262c5 Mon Sep 17 00:00:00 2001 From: Sodbileg Gansukh Date: Mon, 5 Aug 2024 17:00:28 +0800 Subject: [PATCH] Switched from url param to local storage --- .../editor/modals/publish-flow/confirm.js | 6 ++-- .../app/components/modal-publish-flow.hbs | 2 +- .../admin/app/components/posts-list/list.hbs | 8 +++++ ghost/admin/app/components/posts-list/list.js | 33 +++++++++++++++++ .../admin/app/components/posts/analytics.hbs | 1 - ghost/admin/app/components/posts/analytics.js | 36 +++---------------- ghost/admin/app/controllers/posts.js | 35 ------------------ 7 files changed, 50 insertions(+), 71 deletions(-) diff --git a/ghost/admin/app/components/editor/modals/publish-flow/confirm.js b/ghost/admin/app/components/editor/modals/publish-flow/confirm.js index aea42ef4e0..b1ed66f578 100644 --- a/ghost/admin/app/components/editor/modals/publish-flow/confirm.js +++ b/ghost/admin/app/components/editor/modals/publish-flow/confirm.js @@ -92,9 +92,11 @@ export default class PublishFlowOptions extends Component { try { yield this.args.saveTask.perform(); if (this.args.publishOptions.isScheduled) { - window.location.href = '/ghost/#/posts/?success=true'; + localStorage.setItem('ghost-last-scheduled-post', this.args.publishOptions.post.id); + window.location.href = '/ghost/#/posts?type=scheduled'; } else { - window.location.href = `/ghost/#/posts/analytics/${this.args.publishOptions.post.id}/?success=true`; + localStorage.setItem('ghost-last-published-post', this.args.publishOptions.post.id); + window.location.href = `/ghost/#/posts/analytics/${this.args.publishOptions.post.id}`; } } catch (e) { if (e === undefined && this.args.publishOptions.post.errors.length !== 0) { diff --git a/ghost/admin/app/components/modal-publish-flow.hbs b/ghost/admin/app/components/modal-publish-flow.hbs index 7134e9620c..365132cf16 100644 --- a/ghost/admin/app/components/modal-publish-flow.hbs +++ b/ghost/admin/app/components/modal-publish-flow.hbs @@ -5,7 +5,7 @@ {{/if}}