INNER CODE UNIT · JavaScript
toggleResolveTopic
zulip/zulip-mobile · src/action-sheets/index.js:351
const toggleResolveTopic = async ({ auth, streamId, topic, _, streams, zulipFeatureLevel }) => {
// TODO: It'd be nice to use a message ID we know is in the conversation,
// where possible, rather than do this extra fetch. Just need to thread
// such a message ID through to here. (Like web, we'll still need this
// for cases where we can show a topic without knowing of any message ID
// definitely in it, e.g. in the list of topics for a stream.)
const messageId = await fetchSomeMessageIdForConversation(
auth,
streamId,
topic,
streams,
zulipFeatureLevel,
);
if (messageId == null) {
// The conversation is actually empty. This can be perfectly normal,
// because by fetching information outside the events system we're
// exposed to a race: e.g., someone else could have resolved the topic
// already and we just hadn't heard yet.