From 1c2ff950465003f4b6e4729a05b4393c9873446c Mon Sep 17 00:00:00 2001 From: lonyele Date: Mon, 1 Jul 2019 23:42:34 +0900 Subject: [PATCH] feat: add showSettingsPage api for proper routing --- lib/api/src/modules/stories.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/api/src/modules/stories.ts b/lib/api/src/modules/stories.ts index 524063400a9..0d05ff3e730 100644 --- a/lib/api/src/modules/stories.ts +++ b/lib/api/src/modules/stories.ts @@ -8,7 +8,7 @@ type Direction = -1 | 1; type StoryId = string; type ParameterName = string; -type ViewMode = 'story' | 'info' | undefined; +type ViewMode = 'story' | 'info' | 'settings' | undefined; export interface SubState { storiesHash: StoriesHash; @@ -306,6 +306,19 @@ Did you create a path that uses the separator char accidentally, such as 'Vue { + store.setState( + { + viewMode: 'settings', + }, + () => { + navigate(`/settings/${storyId}`); + } + ); + }; + return { api: { storyId: toId, @@ -317,6 +330,7 @@ Did you create a path that uses the separator char accidentally, such as 'Vue