@messenger-box/platform-mobile 0.0.1-alpha.437 → 0.0.1-alpha.438

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.0.1-alpha.438](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.437...v0.0.1-alpha.438) (2024-01-04)
7
+
8
+ **Note:** Version bump only for package @messenger-box/platform-mobile
9
+
6
10
  ## [0.0.1-alpha.437](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.436...v0.0.1-alpha.437) (2024-01-02)
7
11
 
8
12
  **Note:** Version bump only for package @messenger-box/platform-mobile
package/lib/index.js CHANGED
@@ -1813,16 +1813,20 @@ const ConversationViewComponent = ({ channelId, role }) => {
1813
1813
  nextFetchPolicy: 'cache-first',
1814
1814
  refetchWritePolicy: 'merge',
1815
1815
  });
1816
- const { data: channelsDetail, loading: channelLoading, refetch: refetchChannelDetail, } = (0, platform_client_1.useViewChannelDetailQuery)({
1817
- variables: {
1818
- id: channelId === null || channelId === void 0 ? void 0 : channelId.toString(),
1819
- },
1820
- });
1816
+ // const {
1817
+ // data: channelsDetail,
1818
+ // loading: channelLoading,
1819
+ // refetch: refetchChannelDetail,
1820
+ // } = useViewChannelDetailQuery({
1821
+ // variables: {
1822
+ // id: channelId?.toString(),
1823
+ // },
1824
+ // });
1821
1825
  // const { data: users } = useGetAllUsersQuery();
1822
1826
  (0, native_1.useFocusEffect)(react_1.default.useCallback(() => {
1823
1827
  // Do something when the screen is focused
1824
1828
  setSkip(0);
1825
- refetchChannelDetail({ id: channelId === null || channelId === void 0 ? void 0 : channelId.toString() });
1829
+ // refetchChannelDetail({ id: channelId?.toString() });
1826
1830
  refetch({
1827
1831
  channelId: channelId === null || channelId === void 0 ? void 0 : channelId.toString(),
1828
1832
  parentId: null,
@@ -1999,7 +2003,7 @@ const ConversationViewComponent = ({ channelId, role }) => {
1999
2003
  const messageList = (0, react_1.useMemo)(() => {
2000
2004
  let currentDate = '';
2001
2005
  let res = [];
2002
- if (channelMessages.length) {
2006
+ if (channelId && channelMessages && (channelMessages === null || channelMessages === void 0 ? void 0 : channelMessages.length) > 0) {
2003
2007
  (0, lodash_1.orderBy)(channelMessages, ['createdAt'], ['desc']).map((msg) => {
2004
2008
  var _a, _b, _c, _d;
2005
2009
  let message = {
@@ -2032,11 +2036,11 @@ const ConversationViewComponent = ({ channelId, role }) => {
2032
2036
  });
2033
2037
  }
2034
2038
  return res;
2035
- }, [channelMessages]);
2039
+ }, [channelMessages, channelId]);
2036
2040
  const renderSend = (props) => {
2037
- return (react_1.default.createElement(react_native_gifted_chat_1.Send, Object.assign({}, props),
2041
+ return (react_1.default.createElement(react_native_gifted_chat_1.Send, Object.assign({}, props, { disabled: channelId ? false : true }),
2038
2042
  react_1.default.createElement(native_base_1.Box, null,
2039
- react_1.default.createElement(vector_icons_1.MaterialCommunityIcons, { name: "send-circle", style: { marginBottom: 5, marginRight: 5 }, size: 32, color: "#2e64e5" }))));
2043
+ react_1.default.createElement(vector_icons_1.MaterialCommunityIcons, { name: "send-circle", style: { marginBottom: 5, marginRight: 5 }, size: 32, color: channelId ? '#2e64e5' : '#b8b2b2' }))));
2040
2044
  };
2041
2045
  const renderMessageText = (props) => {
2042
2046
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22;
@@ -2224,7 +2228,7 @@ const ConversationViewComponent = ({ channelId, role }) => {
2224
2228
  // }
2225
2229
  // }
2226
2230
  // }}
2227
- onSend: (messages) => { var _a, _b; return handleSend((_b = (_a = messages[0]) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : ' '); }, text: msg ? msg : ' ', onInputTextChanged: (text) => setMsg(text), renderFooter: () => (loading ? react_1.default.createElement(native_base_1.Spinner, null) : imageLoading ? react_1.default.createElement(native_base_1.Spinner, null) : ''), scrollToBottom: true, user: {
2231
+ onSend: (messages) => { var _a, _b; return channelId && handleSend((_b = (_a = messages[0]) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : ' '); }, text: msg ? msg : ' ', onInputTextChanged: (text) => setMsg(text), renderFooter: () => (loading ? react_1.default.createElement(native_base_1.Spinner, null) : imageLoading ? react_1.default.createElement(native_base_1.Spinner, null) : ''), scrollToBottom: true, user: {
2228
2232
  // _id: currentUser?.id || '',
2229
2233
  _id: (auth === null || auth === void 0 ? void 0 : auth.id) || '',
2230
2234
  }, isTyping: true, alwaysShowSend: loading ? false : true,
@@ -2247,7 +2251,7 @@ const ConversationViewComponent = ({ channelId, role }) => {
2247
2251
  // </Center>
2248
2252
  // )
2249
2253
  // }
2250
- renderMessageText: renderMessageText, minInputToolbarHeight: 50, renderActions: renderActions, renderAccessory: renderAccessory, renderMessage: renderMessage, renderChatFooter: () => (react_1.default.createElement(react_1.default.Fragment, null,
2254
+ renderMessageText: renderMessageText, minInputToolbarHeight: 50, renderActions: channelId && renderActions, renderAccessory: renderAccessory, renderMessage: renderMessage, renderChatFooter: () => (react_1.default.createElement(react_1.default.Fragment, null,
2251
2255
  react_1.default.createElement(SlackMessageContainer_1.ImageViewerModal, { isVisible: isShowImageViewer, setVisible: setImageViewer, modalContent: modalContent }),
2252
2256
  react_1.default.createElement(SubscriptionHandler, { channelId: channelId === null || channelId === void 0 ? void 0 : channelId.toString(), subscribeToNewMessages: () => subscribeToMore({
2253
2257
  document: platform_client_1.OnChatMessageAddedDocument,