# leaveUrl on Component View

**URL:** <https://devforum.zoom.us/t/leaveurl-on-component-view/62764>\
**Category:** Web\
**Created:** [January 17, 2022, 2:13pm UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764 "2022-01-17T14:13:44Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![matheuspiffer](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/matheuspiffer/32/33022_2.png) [@matheuspiffer](https://devforum.zoom.us/u/matheuspiffer)\
**Post date:** [January 17, 2022, 2:13pm UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/1 "2022-01-17T14:13:44Z")

</div>

Hi there,

I need to refresh the page once the user leaves the meeting, i can’t find a way to do that using component view.

Using client view i could either use leaveUrl to do that automatically, or use inMeetingServiceListener to capture events like onUserLeave and refresh the page.

appreciate any help.

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [January 22, 2022, 1:40am UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/2 "2022-01-22T01:40:30Z")

</div>

@matheuspiffer Thanks for mentioning this. We don’t have support for in meeting events when it comes to the component view but our engineering team is working hard to bring this in a future relase.

---

<div class="post-metadata">

**Author:** ![clayweb](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/clayweb/32/27348_2.png) [@clayweb](https://devforum.zoom.us/u/clayweb)\
**Post date:** [February 16, 2022, 7:43pm UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/3 "2022-02-16T19:43:42Z")

</div>

Clarifying here: The “leave meeting” functionality seems broken in Component View. Do we need to implement our own exit of the meeting?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [February 17, 2022, 12:59am UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/4 "2022-02-17T00:59:16Z")

</div>

Hey @clayweb , @matheuspiffer ,

It is by design. There is no “page refresh” in Component View after a meeting is left or ended. Unlike Client View, we leave that up to you, the developer.

We empower you by giving you the [leaveMeeting function](https://marketplace.zoom.us/docs/sdk/native-sdks/web/component-view/reference) and [Meeting Left Webhook](https://marketplace.zoom.us/docs/api-reference/zoom-api/events/#/paths/meeting.participant_left/post) so you can implement the flow of your choice. 🙂

Component View works especially well with SPAs (Angular, React, Vue, etc) because leaving or ending a meeting /webinar does not trigger a full page refresh.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [March 10, 2022, 5:04am UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/5 "2022-03-10T05:04:10Z")

</div>

Hello tommy,

How can i customize leaveMeeting function, I prefer to add some more snippets which does some other cleanups required

can i pass it as a parameter during client.init ?

if yes it will be helpful if u can gimme a reference  
i dont see that in API reference

only embeddedclient.leavemeeting is explained

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [March 12, 2022, 12:24am UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/6 "2022-03-12T00:24:15Z")

</div>

Hi, @Zerodistance,

Thank you for your question. Can you share more details about the snippets and other cleanups you’d like to add? This will help determine if it is possible or if there is an alternative solution you can consider.

Thanks,  
Donte

---

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [March 12, 2022, 3:48am UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/7 "2022-03-12T03:48:55Z")

</div>

Hello @donte.zoom

I would like to perform the following when end meeting or leave meeting triggers  
1)clear session storage  
2)make a firebase call to delete some data  
3)refresh the page/redirect to sign-in page  
4)if possible id like to add an alert message asking are you sure you want to leave this meeting

currently, I have added an extra leave meeting button via customize toolbar  
and I’m using` client.leaveMeeting` snippet along with my cleanup code to perform leave meeting manually  
however it would be great if I can perform that by the click of the leave button zoom UI displays

![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/0/8/08de711c01dcf85bef31dcbbde2893d196edff1c.png)  
I have added the way I’m handling this issue now

---

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [April 7, 2022, 6:27am UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/8 "2022-04-07T06:27:23Z")

</div>

@donte.zoom can you please help me with this

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [April 7, 2022, 8:37pm UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/9 "2022-04-07T20:37:52Z")

</div>

Hi, @Zerodistance,

Currently, we don’t support that level of customization on the leave button Zoom UI displays. You want to use the Custom Button to implement your own experience. The custom button allows developers to build custom experiences tailored to their application functionality. For this use case, the custom button is the way to go!

---

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [April 30, 2022, 12:05pm UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/10 "2022-04-30T12:05:43Z")

</div>

@donte.zoom

As per your suggestion, I’ve been using client.leaveMeeting() and client.endMeeting() function using a custom button to close meeting  
However, I’m getting the following error when close is endMeeting of leaveMeeting is Executed

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/b/1/b1bcb0280fee85ab8f0c0937d0a706620906f954.png)

can you please help me with what is going wrong here  
here’s the declaration for Custom Button:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/5/7/5744d8a0c7d76a856f8d32dea5d015ddfbdb7f64.png)

---

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [April 30, 2022, 12:34pm UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/11 "2022-04-30T12:34:16Z")

</div>

@donte.zoom

continuing the discussion  
whenever i end a meeting and try to join another

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/9/f9805ee7c5d5b7e4f57f293497ded3b0957e2e7a.png)  
following error pops up

our use case for zoom here is  
1)multiple 1-on-1 meetings  
2)webinars too  
here user can attend meetings one after other and join webinar

so when im testing this case  
i join a meeting end it then when i try to join another meeting  
i get this error

can u help me with this too

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [May 2, 2022, 11:54am UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/12 "2022-05-02T11:54:00Z")

</div>

> [@Zerodistance](#):
>
> I’m getting the following error when close is endMeeting of leaveMeeting is Executed can you please help me with what is going wrong here

Based on the error, it looks like another action is being executed when the meeting is in a closing state. Can you share the exact actions made when that error occurs? Perhaps you could implement asynchronous logic to properly manage your application’s flow.

---

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [May 3, 2022, 8:32am UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/13 "2022-05-03T08:32:27Z")

</div>

Hello @donte.zoom

Zoom SDK version :2.3.5

Steps to reproduce  
1)run the following code to join meeting

code :-

```auto
	const beginJoin = useCallback(
		(signature) => {
			client
				.init({
					debug: true,
					zoomAppRoot: meetingSDKElement,
					language: "en-US",
					customize: {
						ribbon: {
							isResizable: false,
						},
						video: {
							isResizable: false,
							popper: {
								placement: "bottom",
								disableDraggable: true,
							},
						},
						toolbar: {
							buttons: [
								{
									text: "Polls",
									className: "Polls_ui",
									onClick: () => {
										handlePoll(parseInt(role) === 1 ? "Mod" : "Reg");
									},
								},
								{
									text: Role ? "End Meeting" : "Leave Meeting",
									className: "end-meeting-li",
									onClick: () => {
										yesNoAlert("Are You Sure?", `Do you want to ${Role ? "End Meeting" : "Leave Meeting"}?`, "").then((result) => {
											if (result.isConfirmed) {
												if (Role) {
													client.endMeeting();
												} else {
													client.leaveMeeting();
												}

												endZoomMeeting();
											}
										});
									},
								},
							],
						},
					},
				})
				.then((e) => {
					console.log("success", e);
					client
						.join({
							apiKey: process.env.REACT_APP_ZOOM_API_KEY,
							signature: signature, // role in signature needs to be 0
							meetingNumber: meetingnumber,
							password: password,
							userName: name,
							userEmail: userEmail, // userEmail property required
						})
						.then((e) => {
							console.log("success", e);
							 setAudioTutorial(true);
							
						})
						.catch((e) => {
							if (parseInt(e.errorCode) === 3008) {
								yesNoAlert("Host has not Joined Yet", "", "", "Wait", "Refresh page").then((result) => {
									if (result.isConfirmed) {
									} else {
										window.location.reload();
									}
								});
							}
						});
				})
				.catch((e) => {
					console.log("error", e);
					confirmationAlert("Meeting Initialization Failed", "", "", "", "Exit").then((result) => {
						endZoomMeeting();
					});
				});
		},
		[meetingID]
	);

```

After the meeting is started , i end the meeting with  
my custom leave button  
and following error shows up

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/3/6/360d1e7b1495f2d69c4460e21197ce829f5ea896.png)

this issue halts our whole going into production process  
i hope u can help me with a solution as sooon as possible @donte.zoom

thanks

---

<div class="post-metadata">

**Author:** ![Zerodistance](https://avatars.discourse-cdn.com/v4/letter/z/58f4c7/32.png) [@Zerodistance](https://devforum.zoom.us/u/Zerodistance)\
**Post date:** [May 7, 2022, 3:29am UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/14 "2022-05-07T03:29:34Z")

</div>

Any updates on this, nothing i try is working on this issue ,

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [June 6, 2022, 1:29pm UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/15 "2022-06-06T13:29:46Z")

</div>

Closed on June 6, 2022, 1:29pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![donte.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/donte.zoom/32/24412_2.png) [@donte.zoom](https://devforum.zoom.us/u/donte.zoom)\
**Post date:** [February 14, 2023, 4:59pm UTC](https://devforum.zoom.us/t/leaveurl-on-component-view/62764/16 "2023-02-14T16:59:56Z")

</div>

@Zerodistance,

Sorry for the missed response, we recently introduced a destroy client API, can you try to leverage that API and let us know if it resolves the behavior you are seeing?

Here is the developer forum post with more information on this matter :

> [@Zoom SDK 2.9.7 component view possible bug](https://devforum.zoom.us/t/zoom-sdk-2-9-7-component-view-possible-bug/82227/2):
>
> @it17, Thank you for posting on the Zoom Developer Forum and sorry for the missed response. I see you are using the Meeting SDK 2.9.7 component view and have a problem when the meeting starts after the user tries to join. I’ve seen reports of similar behavior in the past where clicking on join the meeting again without refreshing the page causes unintended behavior. We recently introduced an API to destroy the Component View client to allow re-creation from scratch. Here is the link to the cha…
