-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create collab session #481
base: master
Are you sure you want to change the base?
Conversation
…t an id that can be joined using /collab/create?id endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Jonathan, all of this looks good. Just a couple things to fix, and then we need to wait on a collab-join link to merge. Thanks!
window.addEventListener("beforeunload", this.onLeave); | ||
window.addEventListener("close", this.onLeave); | ||
} | ||
try { | ||
let collabId = await sketch.constructCollabId(this.props.uid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we create a collab session every time someone opens the editor, we will end up creating a lot of sessions that will never be used. I think it would be best to make creating a session an explicit action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking we could have a "Create Collab Session" button, which would then generate and display the URL. If you feel strongly either way you can do that though.
src/lib/fetch.js
Outdated
* @param {string} id //id of CollabSession | ||
*/ | ||
|
||
export const joinCollab = async (id) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that joining a session will be handled by the "collaborative mode" of the editor, so we probably don't need this function. However, if we do end up using this function, there are a couple issues: first, the currently planned endpoint would be collab/join/:id. Secondly, it should open a websocket, rather than make a GET request.
initiateCopy = () => { | ||
navigator.clipboard.writeText(this.props.shareUrl).then( | ||
initiateCopy = (textToBeCopied) => { | ||
console.log("textToBeCopied is: ", textToBeCopied); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably remove debugging console.log
@jonathanbcarlson Hey, could you gate this feature behind |
waiting to merge until able to join collab session with url