Update thread properties

Change the properties of an existing thread


Overview #

Update an existing thread with new data.
Vanilla JavaScript:
await window.CordSDK.thread.updateThread('my-awesome-thread-id', {
  name: 'A more awesome name',
  resolved: true,
});
await window.CordSDK.thread.updateThread('my-awesome-thread-id', {
  name: 'A more awesome name',
  resolved: true,
});
Copy

What this function returns #

A promise that resolves to true if the operation succeeded or rejects if it failed.

Arguments this function takes #


threadID #

required
string
The ID of the thread to update.

data #

required
ClientUpdateThread
The data values that should be updated.

This is an object with the following fields:


resolved #

optional
boolean
Whether the thread is resolved. Setting this to true is equivalent to setting resolvedTimestamp to the current time, and setting this to false is equivalent to setting resolvedTimestamp to null.

typing #

optional
boolean
Whether to mark the current user as typing in the thread. The typing indicator expires after 3 seconds, so to continually show the indicator it needs to be called on an interval. Passing false is a no-op and the indicator will time out normally.

name #

optional
string
The name of the thread. This is shown to users when the thread is referenced, such as in notifications. This should generally be something like the page title.

metadata #

optional
EntityMetadata
Arbitrary key-value pairs that can be used to store additional information.

url #

optional
string
A URL where the thread can be seen. This determines where a user is sent when they click on a reference to this thread, such as in a notification, or if they click on a reference to a message in the thread and the message doesn't have its own URL.

extraClassnames #

optional
string | null
An optional space separated list of classnames to add to the thread.

Ask Cordy