Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
424f6132
Unverified
Commit
424f6132
authored
1 month ago
by
Diego Sampaio
Committed by
GitHub
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: remove ISubscription type casting on RoomOpenerEmbedded (#35295)
parent
683df295
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/meteor/client/lib/utils/mapSubscriptionFromApi.ts
+19
-0
19 additions, 0 deletions
apps/meteor/client/lib/utils/mapSubscriptionFromApi.ts
apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
+4
-2
4 additions, 2 deletions
apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
with
23 additions
and
2 deletions
apps/meteor/client/lib/utils/mapSubscriptionFromApi.ts
0 → 100644
+
19
−
0
View file @
424f6132
import
type
{
ISubscription
,
Serialized
}
from
'
@rocket.chat/core-typings
'
;
export
const
mapSubscriptionFromApi
=
({
ts
,
lr
,
ls
,
_updatedAt
,
oldRoomKeys
,
suggestedOldRoomKeys
,
...
subscription
}:
Serialized
<
ISubscription
>
):
ISubscription
=>
({
...
subscription
,
ts
:
new
Date
(
ts
),
ls
:
new
Date
(
ls
),
lr
:
new
Date
(
lr
),
_updatedAt
:
new
Date
(
_updatedAt
),
...(
oldRoomKeys
&&
{
oldRoomKeys
:
oldRoomKeys
.
map
(({
ts
,
...
key
})
=>
({
...
key
,
ts
:
new
Date
(
ts
)
}))
}),
...(
suggestedOldRoomKeys
&&
{
suggestedOldRoomKeys
:
suggestedOldRoomKeys
.
map
(({
ts
,
...
key
})
=>
({
...
key
,
ts
:
new
Date
(
ts
)
}))
}),
});
This diff is collapsed.
Click to expand it.
apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
+
4
−
2
View file @
424f6132
import
type
{
ISubscription
,
RoomType
}
from
'
@rocket.chat/core-typings
'
;
import
type
{
RoomType
}
from
'
@rocket.chat/core-typings
'
;
import
{
Box
,
States
,
StatesIcon
,
StatesSubtitle
,
StatesTitle
}
from
'
@rocket.chat/fuselage
'
;
import
{
FeaturePreviewOff
,
FeaturePreviewOn
}
from
'
@rocket.chat/ui-client
'
;
import
{
useEndpoint
,
useStream
,
useUserId
}
from
'
@rocket.chat/ui-contexts
'
;
...
...
@@ -20,6 +20,7 @@ import { NotAuthorizedError } from '../../lib/errors/NotAuthorizedError';
import
{
NotSubscribedToRoomError
}
from
'
../../lib/errors/NotSubscribedToRoomError
'
;
import
{
OldUrlRoomError
}
from
'
../../lib/errors/OldUrlRoomError
'
;
import
{
RoomNotFoundError
}
from
'
../../lib/errors/RoomNotFoundError
'
;
import
{
mapSubscriptionFromApi
}
from
'
../../lib/utils/mapSubscriptionFromApi
'
;
const
RoomProvider
=
lazy
(()
=>
import
(
'
./providers/RoomProvider
'
));
const
RoomNotFound
=
lazy
(()
=>
import
(
'
./RoomNotFound
'
));
...
...
@@ -59,7 +60,8 @@ const RoomOpenerEmbedded = ({ type, reference }: RoomOpenerProps): ReactElement
return
;
}
CachedChatSubscription
.
upsertSubscription
(
subscriptionData
.
subscription
as
unknown
as
ISubscription
);
CachedChatSubscription
.
upsertSubscription
(
mapSubscriptionFromApi
(
subscriptionData
.
subscription
));
LegacyRoomManager
.
computation
.
invalidate
();
},
[
subscriptionData
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment