Move understanding of Chats tab location into Nav

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal
2026-02-23 12:05:56 -06:00
committed by GitHub
parent b9d682cf00
commit 4fedbb2237
60 changed files with 1010 additions and 919 deletions

View File

@@ -19,6 +19,7 @@ import { reducer as rootReducer } from '../../../state/reducer.preload.js';
import { IMAGE_JPEG } from '../../../types/MIME.std.js';
import type { AttachmentDraftType } from '../../../types/Attachment.std.js';
import { fakeDraftAttachment } from '../../../test-helpers/fakeAttachment.std.js';
import { NavTab } from '../../../types/Nav.std.js';
const { noop } = lodash;
@@ -36,13 +37,20 @@ describe('both/state/ducks/composer', () => {
},
};
function getRootStateFunction(selectedConversationId?: string) {
function getRootStateFunction(conversationId?: string) {
const state = rootReducer(undefined, noopAction());
return () => ({
...state,
nav: {
selectedLocation: {
tab: NavTab.Chats as const,
details: {
conversationId,
},
},
},
conversations: {
...state.conversations,
selectedConversationId,
},
});
}