Get socketUri for reaction atom connect
@@ -343,11 +343,6 @@ function connectReactionAtom(
});
}
- if (generalSelectors.isAtomOwned(state, connectToAtomUri)) {
- const connectToSocketUri = connectToSocketType
- ? atomUtils.getSocketUri(connectToAtom, connectToSocketType)
- : atomUtils.getDefaultSocketUri(connectToAtom);
-
const getSocketFromDraft = atomDraft => {
const draftContent = atomDraft["content"];
const draftSockets = draftContent["sockets"];
@@ -366,6 +361,11 @@ function connectReactionAtom(
const atomDraftSocketUri = getSocketFromDraft(atomDraft);
+ if (generalSelectors.isAtomOwned(state, connectToAtomUri)) {
+ const connectToSocketUri = connectToSocketType
+ ? atomUtils.getSocketUri(connectToAtom, connectToSocketType)
+ : atomUtils.getDefaultSocketUri(connectToAtom);
+
if (atomDraftSocketUri && connectToSocketUri) {
ownerApi
.serverSideConnect(
@@ -393,7 +393,7 @@ function connectReactionAtom(
// establish connection
const cnctMsg = buildConnectMessage({
connectMessage: "",
- socketUri: undefined, //TODO: FIND CORRECT SOCKETURIS
+ socketUri: `${atomUri}${atomDraftSocketUri}`,
targetSocketUri: connectToSocketUri,
});
