type stringclasses 7
values | content stringlengths 4 9.55k | repo stringlengths 7 96 | path stringlengths 4 178 | language stringclasses 1
value |
|---|---|---|---|---|
ArrowFunction |
() => {
fetchMock.restore();
jest.clearAllMocks();
} | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
async () => {
const video = videoMockFactory({
urls: {
manifests: {
hls: 'https://example.com/hls.m3u8',
},
mp4: {
144: 'https://example.com/144p.mp4',
1080: 'https://example.com/1080p.mp4',
},
thumbnails: {
144: 'https://example... | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
() =>
// The player is created
expect(mockCreatePlayer).toHaveBeenCalledWith(
'videojs',
expect.any(Element),
expect.anything(),
video,
) | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
async () => {
const timedTextTracks = [
timedTextMockFactory({
is_ready_to_show: true,
mode: timedTextMode.TRANSCRIPT,
}),
];
useTimedTextTrack.getState().addMultipleResources(timedTextTracks);
const video = videoMockFactory({
has_transcript: true,
show_download:... | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
async () => {
const timedTextTracks = [
timedTextMockFactory({
id: 'ttt-1',
is_ready_to_show: true,
mode: timedTextMode.SUBTITLE,
}),
];
useTimedTextTrack.getState().addMultipleResources(timedTextTracks);
const video = videoMockFactory({
has_transcript: false,
... | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
async () => {
const video = videoMockFactory({
live_state: liveState.RUNNING,
urls: {
manifests: {
hls: 'https://example.com/hls.m3u8',
},
mp4: {},
thumbnails: {},
},
xmpp: {
bosh_url: 'https://xmpp-server.com/http-bind',
websocket_u... | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
() => {
[liveState.STOPPED, liveState.STOPPING].forEach((state) => {
const video = videoMockFactory({
live_state: state,
});
render(
wrapInIntlProvider(
wrapInRouter(
<PublicVideoDashboard video={video} playerType="videojs" />,
[
{
... | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
(state) => {
const video = videoMockFactory({
live_state: state,
});
render(
wrapInIntlProvider(
wrapInRouter(
<PublicVideoDashboard video={video} playerType="videojs" />,
[
{
path: DASHBOARD_ROUTE(),
rend... | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
({ match }) => (
<span>{`dashboard ${match.params.objectType}` | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
({ match }) => (
<span>{`Error Component: ${match.params.code}` | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
() => {
mockCanUpdate = true;
[liveState.STOPPED, liveState.STOPPING].forEach((state) => {
const video = videoMockFactory({
live_state: state,
});
render(
wrapInIntlProvider(
wrapInRouter(
<PublicVideoDashboard video={video} playerType="videojs" />,
... | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
() => {
[liveState.IDLE, liveState.CREATING, liveState.STARTING].forEach(
(state) => {
const video = videoMockFactory({
live_state: state,
});
render(
wrapInIntlProvider(
wrapInRouter(
<PublicVideoDashboard video={video} playerType="videoj... | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
ArrowFunction |
(state) => {
const video = videoMockFactory({
live_state: state,
});
render(
wrapInIntlProvider(
wrapInRouter(
<PublicVideoDashboard video={video} playerType="videojs" />,
),
),
);
screen.getByText('Live will b... | openfun/marsha | src/frontend/components/PublicVideoDashboard/index.spec.tsx | TypeScript |
MethodDeclaration | /**
* Find the next instance of the term, then scroll to and select it. If it
* doesn't exist, do nothing.
* @param term The search term.
* @param searchOptions Search options.
* @return Whether a result was found.
*/
public findNext(term: string, searchOptions?: ISearchOptions): boolean {
if (!te... | NyleCohen/xterm.js | src/addons/search/SearchHelper.ts | TypeScript |
MethodDeclaration | /**
* Find the previous instance of the term, then scroll to and select it. If it
* doesn't exist, do nothing.
* @param term The search term.
* @param searchOptions Search options.
* @return Whether a result was found.
*/
public findPrevious(term: string, searchOptions?: ISearchOptions): boolean {
... | NyleCohen/xterm.js | src/addons/search/SearchHelper.ts | TypeScript |
MethodDeclaration | /**
* A found substring is a whole word if it doesn't have an alphanumeric character directly adjacent to it.
* @param searchIndex starting indext of the potential whole word substring
* @param line entire string in which the potential whole word was found
* @param term the substring that starts at searchIn... | NyleCohen/xterm.js | src/addons/search/SearchHelper.ts | TypeScript |
MethodDeclaration | /**
* Searches a line for a search term. Takes the provided terminal line and searches the text line, which may contain
* subsequent terminal lines if the text is wrapped. If the provided line number is part of a wrapped text line that
* started on an earlier line then it is skipped since it will be properly s... | NyleCohen/xterm.js | src/addons/search/SearchHelper.ts | TypeScript |
MethodDeclaration | /**
* Translates a buffer line to a string, including subsequent lines if they are wraps.
* Wide characters will count as two columns in the resulting string. This
* function is useful for getting the actual text underneath the raw selection
* position.
* @param line The line being translated.
* @para... | NyleCohen/xterm.js | src/addons/search/SearchHelper.ts | TypeScript |
MethodDeclaration | /**
* Selects and scrolls to a result.
* @param result The result to select.
* @return Whethera result was selected.
*/
private _selectResult(result: ISearchResult): boolean {
if (!result) {
this._terminal.clearSelection();
return false;
}
this._terminal._core.selectionManager.setSel... | NyleCohen/xterm.js | src/addons/search/SearchHelper.ts | TypeScript |
FunctionDeclaration | /**
* Api Operation details.
*/
export function getApiOperation(args: GetApiOperationArgs, opts?: pulumi.InvokeOptions): Promise<GetApiOperationResult> {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
return pulumi.runtime.invoke("azure-next... | pulumi/pulumi-azure-nextgen | sdk/nodejs/apimanagement/v20180101/getApiOperation.ts | TypeScript |
InterfaceDeclaration |
export interface GetApiOperationArgs {
/**
* API revision identifier. Must be unique in the current API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number.
*/
readonly apiId: string;
/**
* Operation identifier within an API. Must be unique... | pulumi/pulumi-azure-nextgen | sdk/nodejs/apimanagement/v20180101/getApiOperation.ts | TypeScript |
InterfaceDeclaration | /**
* Api Operation details.
*/
export interface GetApiOperationResult {
/**
* Description of the operation. May include HTML formatting tags.
*/
readonly description?: string;
/**
* Operation Name.
*/
readonly displayName: string;
/**
* Resource ID.
*/
readonly i... | pulumi/pulumi-azure-nextgen | sdk/nodejs/apimanagement/v20180101/getApiOperation.ts | TypeScript |
ArrowFunction |
() => {
const { isAuthenticated } = this.props;
this.setHeader();
if (this.rid) {
this.sub?.subscribe?.();
if (isAuthenticated) {
this.init();
} else {
EventEmitter.addEventListener('connected', this.handleConnected);
}
}
if (this.jumpToMessageId) {
this.jumpToMessage(this.... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
key => nextState[key] !== state[key] | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
key => !dequal(nextState.roomUpdate[key], roomUpdate[key]) | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
// FIXME: why do I need to tell ts this is non null if we have that if condition above?
await obj!.update(r => {
r.draftMessage = text;
});
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
r => {
r.draftMessage = text;
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
const { room, unreadsCount, roomUserId, joined } = this.state;
const { navigation, isMasterDetail, theme, baseUrl, user, insets, route } = this.props;
const { rid, tmid } = this;
if (!room.rid) {
return;
}
const prid = room?.prid;
const isGroupChat = RocketChat.isGroupChat(room as ISubscripti... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => (
<LeftButtons
tmid={tmid} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => (
<RoomHeader
rid={rid} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(screen?: string) => {
logEvent(events.ROOM_GO_RA);
const { room, member, joined } = this.state;
const { navigation, isMasterDetail } = this.props;
if (isMasterDetail) {
// @ts-ignore TODO: find a way to make it work
navigation.navigate('ModalStackNavigator', {
// @ts-ignore
screen: screen ?? 'Ro... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
const { room } = this.state;
const { user } = this.props;
const readOnly = await isReadOnly(room as ISubscription, user.username as string);
this.setState({ readOnly });
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
try {
this.setState({ loading: true });
const { room, joined } = this.state;
if (!this.rid) {
return;
}
if (this.tmid) {
await RoomServices.getThreadMessages(this.tmid, this.rid);
} else {
const newLastOpen = new Date();
await RoomServices.getMessages(room);
// if... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
this.init();
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
const { room } = this.state;
const { t } = room;
if ('id' in room && t === 'd' && !RocketChat.isGroupChat(room)) {
try {
const roomUserId = RocketChat.getUidDirectMessage(room);
this.setState({ roomUserId }, () => this.setHeader());
const result = await RocketChat.getUserInfo(roomU... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => this.setHeader() | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async (rid: string) => {
try {
const db = database.active;
const subCollection = await db.get('subscriptions');
const room = await subCollection.find(rid);
this.setState({ room });
if (!this.tmid) {
this.setHeader();
}
this.observeRoom(room);
} catch (error) {
if (this.t !== 'd') {
... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
this.findAndObserveRoom(rid);
this.init();
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
if (this.sub && this.sub.unsubscribe) {
await this.sub.unsubscribe();
}
delete this.sub;
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(room: TSubscriptionModel) => {
const observable = room.observe();
this.subSubscription = observable.subscribe(changes => {
const roomUpdate = roomAttrsUpdate.reduce((ret: any, attr) => {
ret[attr] = changes[attr];
return ret;
}, {});
if (this.mounted) {
this.internalSetState({ room: changes, ... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
changes => {
const roomUpdate = roomAttrsUpdate.reduce((ret: any, attr) => {
ret[attr] = changes[attr];
return ret;
}, {});
if (this.mounted) {
this.internalSetState({ room: changes, roomUpdate });
} else {
// @ts-ignore
this.state.room = changes;
// @ts-ignore
this.state.roomUp... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(ret: any, attr) => {
ret[attr] = changes[attr];
return ret;
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: TAnyMessageModel) => {
// @ts-ignore
this.messageErrorActions?.showMessageErrorActions(message);
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: TAnyMessageModel) => {
const newMessage = {
id: message.id,
subscription: {
// @ts-ignore TODO: we can remove this after we merge a PR separating IMessage vs IMessageFromServer
id: message.subscription.id
},
msg: message?.attachments?.[0]?.description || message.msg
} as TMessageModel... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
this.setState({ selectedMessage: undefined, editing: false });
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async (message: TAnyMessageModel) => {
this.setState({ selectedMessage: undefined, editing: false });
try {
await RocketChat.editMessage(message);
} catch (e) {
log(e);
}
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: TAnyMessageModel, mention: boolean) => {
this.setState({
selectedMessage: message,
replying: true,
replyWithMention: mention
});
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
this.setState({ selectedMessage: undefined, replying: false, replyWithMention: false });
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: TAnyMessageModel) => {
this.setState({ selectedMessage: message, reacting: true });
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
this.setState({ selectedMessage: undefined, reacting: false });
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: TAnyMessageModel) => {
// @ts-ignore
this.messageActions?.showMessageActions(message);
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(attachment: IAttachment) => {
const { navigation } = this.props;
// @ts-ignore
navigation.navigate('AttachmentView', { attachment });
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async (shortname: string, messageId: string) => {
try {
await RocketChat.setReaction(shortname, messageId);
this.onReactionClose();
Review.pushPositiveEvent();
} catch (e) {
log(e);
}
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: TAnyMessageModel) => {
this.setState({ selectedMessage: message, reactionsModalVisible: true });
Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
this.setState({ selectedMessage: undefined, reactionsModalVisible: false });
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
logEvent(events.ROOM_ENCRYPTED_PRESS);
const { navigation, isMasterDetail } = this.props;
const screen = { screen: 'E2EHowItWorksView', params: { showCloseModal: true } };
if (isMasterDetail) {
// @ts-ignore
return navigation.navigate('ModalStackNavigator', screen);
}
// @ts-ignore
naviga... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(item: TAnyMessageModel) => {
const { navigation } = this.props;
navigation.push('RoomView', {
rid: item.drid as string,
prid: item.rid,
name: item.msg,
t: 'p' as SubscriptionType
});
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
if (!this.rid) {
return;
}
const db = database.active;
const observable = await db
.get('subscriptions')
.query(Q.where('archived', false), Q.where('open', true), Q.where('rid', Q.notEq(this.rid)))
.observeWithColumns(['unread']);
this.queryUnreads = observable.subscribe(data => {
... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
data => {
const { unreadsCount } = this.state;
const newUnreadsCount = data.filter(s => s.unread > 0).reduce((a, b) => a + (b.unread || 0), 0);
if (unreadsCount !== newUnreadsCount) {
this.setState({ unreadsCount: newUnreadsCount }, () => this.setHeader());
}
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
s => s.unread > 0 | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(a, b) => a + (b.unread || 0) | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(item: TAnyMessageModel) => this.navToThread(item) | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: IMessage) => {
if (message.tmid && message.tmid === this.tmid) {
return false;
}
if (!message.tmid && message.rid === this.rid) {
return false;
}
return true;
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async (messageUrl?: string) => {
if (!messageUrl) {
return;
}
try {
this.setState({ showingBlockingLoader: true });
const parsedUrl = parse(messageUrl, true);
const messageId = parsedUrl.query.msg;
if (messageId) {
await this.jumpToMessage(messageId);
}
this.setState({ showingBlockingLoa... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async (messageId: string) => {
try {
this.setState({ showingBlockingLoader: true });
const message = await RoomServices.getMessageInfo(messageId);
if (!message) {
return;
}
if (this.shouldNavigateToRoom(message)) {
if (message.rid !== this.rid) {
this.navToRoom(message);
} else {
... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
res => setTimeout(res, 5000) | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: IMessage) => {
const { dispatch } = this.props;
dispatch(replyBroadcast(message));
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
this.init();
EventEmitter.removeListener('connected', this.handleConnected);
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
({ rid }: { rid: string }) => {
const { room } = this.state;
if (rid === this.rid) {
Navigation.navigate('RoomsListView');
!this.isOmnichannel &&
showErrorAlert(I18n.t('You_were_removed_from_channel', { channel: RocketChat.getRoomTitle(room) }), I18n.t('Oops'));
}
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(...args: any[]) => {
if (!this.mounted) {
return;
}
// @ts-ignore TODO: TS is complaining about this, but I don't feel like changing rn since it should be working
this.setState(...args);
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: string, tmid?: string, tshow?: boolean) => {
logEvent(events.ROOM_SEND_MESSAGE);
const { rid } = this.state.room;
const { user } = this.props;
RocketChat.sendMessage(rid, message, this.tmid || tmid, user, tshow).then(() => {
if (this.list && this.list.current) {
// @ts-ignore
this.list.cur... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
if (this.list && this.list.current) {
// @ts-ignore
this.list.current.update();
}
this.setLastOpen(null);
Review.pushPositiveEvent();
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(name: string): IReduxEmoji | null => {
const { customEmojis } = this.props;
const emoji = customEmojis[name];
if (emoji) {
return emoji;
}
return null;
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(lastOpen: Date | null) => this.setState({ lastOpen }) | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
this.internalSetState({
joined: true
});
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
logEvent(events.ROOM_JOIN);
try {
const { room } = this.state;
if (this.isOmnichannel) {
if ('_id' in room) {
await takeInquiry(room._id);
}
this.onJoin();
} else {
const { joinCodeRequired, rid } = room;
if (joinCodeRequired) {
// @ts-ignore
this.joinCode... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
logEvent(events.ROOM_RESUME);
try {
const { room } = this.state;
if (this.isOmnichannel) {
if ('rid' in room) {
await takeResume(room.rid);
}
this.onJoin();
}
} catch (e) {
log(e);
}
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(tmid: string, messageId: string) => {
const { rid } = this.state.room;
return getThreadName(rid, tmid, messageId);
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async (isFollowingThread: boolean, tmid?: string) => {
try {
const threadMessageId = tmid ?? this.tmid;
if (!threadMessageId) {
return;
}
await RocketChat.toggleFollowMessage(threadMessageId, !isFollowingThread);
EventEmitter.emit(LISTENER, { message: isFollowingThread ? I18n.t('Unfollowed_thread'... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(messageId: string) => {
const { room } = this.state;
const { theme } = this.props;
return getBadgeColor({ subscription: room, theme, messageId });
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(navParam: any) => {
const { navigation, user, isMasterDetail } = this.props;
logEvent(events[`ROOM_GO_${navParam.t === 'd' ? 'USER' : 'ROOM'}_INFO`]);
if (navParam.rid === user.id) {
return;
}
if (isMasterDetail) {
navParam.showCloseModal = true;
// @ts-ignore
navigation.navigate('ModalStackNavi... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async (item: TAnyMessageModel | { tmid: string }) => {
const { roomUserId } = this.state;
const { navigation } = this.props;
if (!this.rid) {
return;
}
if (item.tmid) {
let name = '';
let jumpToMessageId = '';
if ('id' in item) {
name = item.tmsg ?? '';
jumpToMessageId = item.id;
}
... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async (message: TAnyMessageModel) => {
const { navigation, isMasterDetail } = this.props;
const roomInfo = await getRoomInfo(message.rid);
return goRoom({
item: roomInfo as TGoRoomItem,
isMasterDetail,
navigationMethod: navigation.push,
jumpToMessageId: message.id
});
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
const { room } = this.state;
if ('id' in room) {
const { jitsiTimeout } = room;
if (jitsiTimeout && jitsiTimeout < new Date()) {
showErrorAlert(I18n.t('Call_already_ended'));
} else {
RocketChat.callJitsi(room);
}
}
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
({ event }: { event: IKeyCommandEvent }) => {
if (this.rid) {
const { input } = event;
if (handleCommandScroll(event)) {
const offset = input === 'UIKeyInputUpArrow' ? 100 : -100;
this.offset += offset;
// @ts-ignore
this.flatList?.scrollToOffset({ offset: this.offset });
} else if (handleCo... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
({
actionId,
appId,
value,
blockId,
rid,
mid
}: {
actionId: string;
appId: string;
value: any;
blockId: string;
rid: string;
mid: string;
}) =>
RocketChat.triggerBlockAction({
blockId,
actionId,
value,
mid,
rid,
appId,
container: {
type: ContainerTypes.MESSAGE,
... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
const { room } = this.state;
if ('id' in room) {
try {
const db = database.active;
await db.write(async () => {
await room.update(r => {
r.bannerClosed = true;
});
});
} catch {
// do nothing
}
}
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
async () => {
await room.update(r => {
r.bannerClosed = true;
});
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
r => {
r.bannerClosed = true;
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(message: TAnyMessageModel): boolean => {
const { room } = this.state;
if ('id' in room) {
return room?.ignored?.includes?.(message?.u?._id) ?? false;
}
return false;
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(loaderItem: TAnyMessageModel) => {
const { room } = this.state;
return RoomServices.getMoreMessages({
rid: room.rid,
tmid: this.tmid,
t: room.t as any,
loaderItem
});
} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(item: TAnyMessageModel, previousItem: TAnyMessageModel, highlightedMessage?: string) => {
const { room, lastOpen, canAutoTranslate } = this.state;
const { user, Message_GroupingPeriod, Message_TimeFormat, useRealName, baseUrl, Message_Read_Receipt_Enabled, theme } =
this.props;
let dateSeparator = null;
le... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
const { joined, room, selectedMessage, editing, replying, replyWithMention, readOnly, loading } = this.state;
const { navigation, theme, route } = this.props;
const usedCannedResponse = route?.params?.usedCannedResponse;
if (!this.rid) {
return null;
}
if ('onHold' in room && room.onHold) {
... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
() => {
const { room, readOnly } = this.state;
const { user } = this.props;
if (!('id' in room)) {
return null;
}
return (
<>
<MessageActions
// @ts-ignore
ref={ref => (this.messageActions = ref)} | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
ArrowFunction |
(state: IApplicationState) => ({
user: getUserSelector(state),
isMasterDetail: state.app.isMasterDetail,
appState: state.app.ready && state.app.foreground ? 'foreground' : 'background',
useRealName: state.settings.UI_Use_Real_Name as boolean,
isAuthenticated: state.login.isAuthenticated,
Message_GroupingPeriod: ... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
InterfaceDeclaration |
interface IRoomViewProps extends IBaseScreen<ChatsStackParamList, 'RoomView'> {
user: Pick<ILoggedUser, 'id' | 'username' | 'token' | 'showMessageInMainThread'>;
appState: string;
useRealName?: boolean;
isAuthenticated: boolean;
Message_GroupingPeriod?: number;
Message_TimeFormat?: string;
Message_Read_Receipt_... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
InterfaceDeclaration |
interface IRoomViewState {
[key: string]: any;
joined: boolean;
room: TSubscriptionModel | { rid: string; t: string; name?: string; fname?: string; prid?: string; joinCodeRequired?: boolean };
roomUpdate: {
[K in TRoomUpdate]?: any; // TODO: get type from TSubscriptionModel
};
member: any;
lastOpen: Date | nu... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
TypeAliasDeclaration |
type TRoomUpdate = typeof roomAttrsUpdate[number]; | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
MethodDeclaration |
componentDidMount() {
this.mounted = true;
this.didMountInteraction = InteractionManager.runAfterInteractions(() => {
const { isAuthenticated } = this.props;
this.setHeader();
if (this.rid) {
this.sub?.subscribe?.();
if (isAuthenticated) {
this.init();
} else {
EventEmitter.addEventL... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
MethodDeclaration |
shouldComponentUpdate(nextProps: IRoomViewProps, nextState: IRoomViewState) {
const { state } = this;
const { roomUpdate, member } = state;
const { appState, theme, insets, route } = this.props;
if (theme !== nextProps.theme) {
return true;
}
if (appState !== nextProps.appState) {
return true;
}
... | ankitsingh1492/Rocket.Chat.ReactNative | app/views/RoomView/index.tsx | TypeScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.