diff --git a/src/reducers/editor.ts b/src/reducers/editor.ts index f64762ed..c694c1a4 100644 --- a/src/reducers/editor.ts +++ b/src/reducers/editor.ts @@ -100,6 +100,7 @@ const INITIAL_STATE : EditorState = { imagePropertiesDialogIndex: 0, imageBrowserDialogOpen: false, imageBrowserDialogIndex: undefined, + editingCardSimilarity: {} }; const app = (state : EditorState = INITIAL_STATE, action : SomeAction) : EditorState => { @@ -117,6 +118,8 @@ const app = (state : EditorState = INITIAL_STATE, action : SomeAction) : EditorS updatedFromContentEditable: {}, selectedTab: DEFAULT_TAB, selectedEditorTab: DEFAULT_EDITOR_TAB, + //Throw out any editing card similarity + editingCardSimilarity: {} }; case EDITING_FINISH: return { @@ -129,6 +132,7 @@ const app = (state : EditorState = INITIAL_STATE, action : SomeAction) : EditorS cardExtractionVersion: -1, substantive:false, updatedFromContentEditable: {}, + editingCardSimilarity: {} }; case EDITING_EDITOR_MINIMIZED: return { diff --git a/src/selectors.ts b/src/selectors.ts index 87c37b1f..569409be 100644 --- a/src/selectors.ts +++ b/src/selectors.ts @@ -252,6 +252,7 @@ export const selectPermissionsPendingPermissionType = (state : State) => state.p const selectTweets = (state : State) => state.data ? state.data.tweets : {}; export const selectTweetsLoading = (state : State) => state.data ? state.data.tweetsLoading : false; export const selectCardSimilarity = (state : State) => state.data ? state.data.cardSimilarity : {}; +export const selectEditingCardSimilarity = (state : State) => state.editor ? state.editor.editingCardSimilarity : {}; export const selectActivePreviewCardId = (state : State) => state.app ? state.app.hoverCardId : ''; export const selectPreviewCardX = (state : State) => state.app ? state.app.hoverX : 0; export const selectPreviewCardY = (state : State) => state.app ? state.app.hoverY : 0; diff --git a/src/types.ts b/src/types.ts index ffbdbbc1..3d9f6e91 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1262,7 +1262,7 @@ export type DataState = { pendingNewCardIDToNavigateTo: CardID, //When we're doing card similarity based on embedings, we have to reach out //to a cloud function. This is where we store that information. - cardSimilarity: CardSimilarityMap; + cardSimilarity: CardSimilarityMap } export type EditorState = { @@ -1294,6 +1294,8 @@ export type EditorState = { imageBrowserDialogOpen: boolean, //Undefined communicates 'add to end' imageBrowserDialogIndex?: number, + //The same as data.cardSimilarity, but for the editing card + editingCardSimilarity: SortExtra } export type FindState = {