Fixed Bug 69991: Client: SDK: Fixed getting primary link for shared room

This commit is contained in:
Ilya Oleshko 2024-09-02 17:29:57 +03:00
parent de61c54e21
commit a86a75ba81

View File

@ -53,9 +53,9 @@ const Sdk = ({
user,
updateProfileCulture,
getRoomsIcon,
fetchExternalLinks,
getFilePrimaryLink,
getFilesSettings,
getPrimaryLink,
}) => {
const [isDataReady, setIsDataReady] = useState(false);
@ -200,20 +200,11 @@ const Sdk = ({
(data[0].roomType === RoomsType.CustomRoom && data[0].shared) ||
(data[0].roomType === RoomsType.FormRoom && data[0].shared)
) {
const links = await fetchExternalLinks(data[0].id);
const link = await getPrimaryLink(data[0].id);
const requestTokens = links.map((link) => {
const { id, title, requestToken, primary } = link.sharedTo;
const { id, title, requestToken, primary } = link.sharedTo;
return {
id,
primary,
title,
requestToken,
};
});
data[0].requestTokens = requestTokens;
data[0].requestTokens = [{ id, primary, title, requestToken }];
}
frameCallEvent({ event: "onSelectCallback", data });
@ -321,7 +312,6 @@ export default inject(
settingsStore,
filesSettingsStore,
peopleStore,
publicRoomStore,
userStore,
filesStore,
}) => {
@ -331,8 +321,7 @@ export default inject(
const { loadCurrentUser, user } = userStore;
const { updateProfileCulture } = peopleStore.targetUserStore;
const { getIcon, getRoomsIcon, getFilesSettings } = filesSettingsStore;
const { fetchExternalLinks } = publicRoomStore;
const { getFilePrimaryLink } = filesStore;
const { getFilePrimaryLink, getPrimaryLink } = filesStore;
return {
theme,
@ -347,9 +336,9 @@ export default inject(
isLoaded,
updateProfileCulture,
user,
fetchExternalLinks,
getFilePrimaryLink,
getFilesSettings,
getPrimaryLink,
};
},
)(