Skip to content

Commit

Permalink
Account for renaming of urlStore to selectionStore
Browse files Browse the repository at this point in the history
From #19623
  • Loading branch information
IanVS committed Nov 21, 2022
1 parent 0cc9f81 commit 1137c3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion code/lib/instrumenter/src/instrumenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ export class Instrumenter {
// returns the original result.
track(method: string, fn: Function, args: any[], options: Options) {
const storyId: StoryId =
args?.[0]?.__storyId__ || globalThis.__STORYBOOK_PREVIEW__?.urlStore?.selection?.storyId;
args?.[0]?.__storyId__ ||
globalThis.__STORYBOOK_PREVIEW__?.selectionStore?.selection?.storyId;
const { cursor, ancestors } = this.getState(storyId);
this.setState(storyId, { cursor: cursor + 1 });
const id = `${ancestors.slice(-1)[0] || storyId} [${cursor}] ${method}`;
Expand Down
2 changes: 1 addition & 1 deletion code/types/globalThis.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
import type { AddonStore } from '@storybook/addons';
import type { Channel } from '@storybook/channels';
import type { ClientApi, StoryStore } from '@storybook/client-api';
import type { PreviewWeb } from 'lib/preview-web/src';
import type { PreviewWeb } from '@storybook/preview-web';

declare global {
var CHANNEL_OPTIONS: CoreConfig['channelOptions'];
Expand Down

0 comments on commit 1137c3b

Please sign in to comment.