From d666b465b95293806ce4bfff680ad4e79a07145f Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Tue, 18 May 2021 01:48:34 +0000 Subject: [PATCH] hotkeys: Go through hashchange to open drafts. This helps us keep all the logic related to changing hash of webapp in hashchange itself, like not showing drafts to web-pubic-visitors. --- frontend_tests/node_tests/hotkey.js | 2 +- static/js/hotkey.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend_tests/node_tests/hotkey.js b/frontend_tests/node_tests/hotkey.js index 1b1d574b03..901bd950ba 100644 --- a/frontend_tests/node_tests/hotkey.js +++ b/frontend_tests/node_tests/hotkey.js @@ -320,7 +320,7 @@ run_test("drafts closed w/other overlay", (override) => { run_test("drafts closed launch", (override) => { override(overlays, "is_active", () => false); - assert_mapping("d", drafts, "launch"); + assert_mapping("d", browser_history, "go_to_location"); }); run_test("misc", () => { diff --git a/static/js/hotkey.js b/static/js/hotkey.js index fb6dd01687..3c18678d8f 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -804,7 +804,7 @@ export function process_hotkey(e, hotkey) { compose_actions.start("private", {trigger: "compose_hotkey"}); return true; case "open_drafts": - drafts.launch(); + browser_history.go_to_location("drafts"); return true; case "C_deprecated": ui.maybe_show_deprecation_notice("C");