From 7ba20c78b1fd9098d41c670c1e28bfdd54b89f8b Mon Sep 17 00:00:00 2001 From: or-else Date: Sun, 22 Aug 2021 11:45:50 -0700 Subject: [PATCH] adding unarchive menu item --- src/widgets/context-menu.jsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/widgets/context-menu.jsx b/src/widgets/context-menu.jsx index 62592512..a73fbdff 100644 --- a/src/widgets/context-menu.jsx +++ b/src/widgets/context-menu.jsx @@ -241,6 +241,22 @@ class ContextMenu extends React.Component { }); } }, + 'topic_restore': { + id: 'topic_restore', + title: formatMessage(messages.unarchive), + handler: (params, errorHandler) => { + const topic = this.props.tinode.getTopic(params.topicName); + if (!topic) { + console.log("Topic not found: ", params.topicName); + return; + } + return topic.archive(false).catch((err) => { + if (errorHandler) { + errorHandler(err.message, 'err'); + } + }); + } + }, // menu_item_edit_permissions is defined elsewhere. 'permissions': { id: 'permissions',