Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion app/views/RoomView/context.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
import { createContext, useContext } from 'react';

import { type ILastMessage, type TSubscriptionModel } from '../../definitions';

export type TMessageAction = 'reply' | 'quote' | 'edit' | 'react' | null;

/**
* Type for room in RoomContext, matching IRoomViewState.room
* Can be either a full TSubscriptionModel or a partial room object (e.g., for threads)
*/
export type TRoomContextRoom =
| TSubscriptionModel
| {
rid: string;
t: string;
name?: string;
fname?: string;
prid?: string;
joinCodeRequired?: boolean;
status?: string;
lastMessage?: ILastMessage;
sysMes?: boolean;
onHold?: boolean;
};

export interface IRoomContext {
rid?: string;
t?: string;
tmid?: string;
room: any; // FIXME: type it properly after we migrate RoomView to hooks
room: TRoomContextRoom;
sharing?: boolean;
action?: TMessageAction;
isAutocompleteVisible?: boolean;
Expand Down