-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove meteor.startup from jump-to-*-message (#34027)
- Loading branch information
1 parent
d9de9fb
commit f8ecbd7
Showing
7 changed files
with
55 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
apps/meteor/client/components/message/toolbar/useJumpToMessageContextAction.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { IMessage } from '@rocket.chat/core-typings'; | ||
import { useEffect } from 'react'; | ||
|
||
import type { MessageActionContext } from '../../../../app/ui-utils/client/lib/MessageAction'; | ||
import { MessageAction } from '../../../../app/ui-utils/client/lib/MessageAction'; | ||
import { setMessageJumpQueryStringParameter } from '../../../lib/utils/setMessageJumpQueryStringParameter'; | ||
|
||
export const useJumpToMessageContextAction = ( | ||
message: IMessage, | ||
{ id, order, hidden, context }: { id: string; order: number; hidden?: boolean; context: MessageActionContext[] }, | ||
) => { | ||
useEffect(() => { | ||
if (hidden) { | ||
return; | ||
} | ||
|
||
MessageAction.addButton({ | ||
id, | ||
icon: 'jump', | ||
label: 'Jump_to_message', | ||
context, | ||
async action() { | ||
setMessageJumpQueryStringParameter(message._id); | ||
}, | ||
order, | ||
group: 'message', | ||
}); | ||
|
||
return () => { | ||
MessageAction.removeButton(id); | ||
}; | ||
}, [hidden, context, id, message._id, order]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
import './jumpToMessage'; | ||
import './jumpToPinMessage'; | ||
import './jumpToSearchMessage'; | ||
import './jumpToStarMessage'; | ||
import './permalinkPinned'; | ||
import './unpinMessage'; |
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
apps/meteor/client/startup/actionButtons/jumpToPinMessage.ts
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
apps/meteor/client/startup/actionButtons/jumpToSearchMessage.ts
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
apps/meteor/client/startup/actionButtons/jumpToStarMessage.ts
This file was deleted.
Oops, something went wrong.