Hi, all of a sudden I just started getting such errors for all my functions in JS.
Only change that happened was I removed a chat window object from site and create a new one with same name.
Can someone please guide me on this?
Thanks.
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
That won't work as Wix Data Options can only be run in the backend.
https://www.wix.com/corvid/reference/wix-data.html#WixDataOptions
The options parameter can only be used in backend code. Permission checks and hooks always run for wix-data functions called from Page, Site and Public code.
Also, note as mentioned above, the maixmize function will only work if the Wix Chatbox is shown on your page whether in the minimized state or already maximized.
If it is already hidden from the page, then you will need to have it shown first before it can be maximized.
Finally, make sure that your channel id is correct type too, are you using social with site member to site member?
Or are you trying to use social on business with site member or visitor chatting with site owner/admin/contributor?.
Site visitors can participate in the following chat scenarios:
Business Chat: Site members and visitors chat with the site owner or contributor, referred to as the "business."
Social Chat: Site members chat with other site members, privately or in a group chat.
Hi GOS, unfortenatelly focuschannel() does not maximize the chat baloon and show the previous chat with that channelID. Just fyi, as channelID I have used the username of the previous chat.
You may see the exact code as below;
export function button1_click(event) { let isGlobal = $w("#wixChat2").global; // true let isHidden = $w("#wixChat2").hidden; // false let myId = $w("#repeater1").id; // "myElement" let isMaximized = $w("#wixChat2").maximized; // false let options = { "suppressAuth": true, "suppressHooks": true } let channelInfo = { "channelId": "92f7ac00-04c5-4ef4-aac2-01499873bcd0" } $w("#wixChat2").focusChannel(channelInfo) .then(() => { console.log("Done maximizing chatbox and focusing channel"); }) .catch((err) => { console.log(err); });
As for the focusChannel option, are you using Business or Social as you need to set it up appropriately as Type only works for Business,
Plus, as shown above, it needs to be in the minimize option and if your Chatbox is hidden it needs to be shown.
You can focus on a channel by specifying one of the following:
Channel ID: Focus on the channel with the specified ID. type is ignored.
Type: Focus on the channel of the specified type. Currently, only type Business is supported.
Examples
Expand the chatbox and focus it on the channel with the specified ID
let channelInfo = { "channelId": "23b345b6-c78d-9012-e3f4-567g89h0i01k" } $w("#myChatbox").focusChannel(channelInfo) .then(() => { console.log("Done maximizing chatbox and focusing channel"); }) .catch((err) => { console.log(err); });
Expand the chatbox and focus it on the business channel
let channelInfo = { "type": "Business" } $w("#myChatbox").focusChannel(channelInfo) .then(() => { console.log("Done maximizing chatbox and focusing channel"); }) .catch((err) => { console.log(err); });
Just to note that if you use mazimize, then that will only work when the Wix Chatbox is set to minimize.
It will not work when it is hidden, then you will need it to be shown first.
Please check your code setup for when you use the maximize option as if you have hidden the Wix Chatbox it needs to be set to show first and then maximize, like as in the example linked above.
See here on this test site.
https://givemeawhisky.wixsite.com/test/blank
$w.onReady(function () { }); export function button1_click(event) { $w('#wixChat1').hide() } export function button2_click(event) { $w('#wixChat1').show() $w('#wixChat1').maximize(); }
Okay I have just checked the Wix Chat example as here and there is no error shown in the code in the Wix Editor.
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-corvid-chat/p-1/dl-5e1b2dc807c1a200179327fa
Live site test.
https://www.wix.com/code-examples/corvid-chat
If you click on the Questions? Chat with us... button it all works fine and the Wix Chat app opens as it should.
Here we go, towards the bottom of this post see the replies from Erez.
https://www.wix.com/corvid/forum/community-discussion/open-chat-widget-when-button-is-clicked
And also these too.
https://www.wix.com/corvid/forum/community-discussion/bug-chatbox-maximize-function-bug
https://www.wix.com/corvid/forum/community-discussion/how-to-access-wix-chat-chatbox-api-events
No blame us both as you had put in your original post that it was a chat box 😉
https://www.wix.com/corvid/reference/$w.Chatbox.html
Anyways, the Chatbox does support maximize so please ignore the error and test it on your site in preview and live mode and see if it works.
I think that there might have been a few teething problems with it when it was first launched and I think that this was one of them and it was working in the live site.
Your issue, make sure that the element that you are using for this does actually support maximize.
Like the Wix Chatbox which supports maximize.
https://www.wix.com/corvid/reference/$w.Chatbox.html#maximize
$w("#myChatbox").maximize();