@messenger-box/platform-mobile 0.0.1-alpha.388 → 0.0.1-alpha.391

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,14 @@
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.391](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.390...v0.0.1-alpha.391) (2023-09-13)
7
+
8
+ **Note:** Version bump only for package @messenger-box/platform-mobile
9
+
10
+ ## [0.0.1-alpha.390](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.389...v0.0.1-alpha.390) (2023-08-29)
11
+
12
+ **Note:** Version bump only for package @messenger-box/platform-mobile
13
+
6
14
  ## [0.0.1-alpha.388](https://github.com/CDEBase/messenger-box/compare/v0.0.1-alpha.387...v0.0.1-alpha.388) (2023-08-25)
7
15
 
8
16
  **Note:** Version bump only for package @messenger-box/platform-mobile
package/lib/index.js CHANGED
@@ -1571,7 +1571,7 @@ exports.config = (0, envalid_1.cleanEnv)(process['APP_ENV'] || process.env, {
1571
1571
  // THREADS_PATH: str({ default: 'MainStack.ThreadMessage' }),
1572
1572
  THREAD_MESSEGE_PATH: (0, envalid_1.str)({ default: 'MainStack.ThreadMessage' }),
1573
1573
  THREADS_PATH: (0, envalid_1.str)({ default: 'MainStack.Thread' }),
1574
- CALL_TO_ACTION_PATH: (0, envalid_1.str)({ default: 'MainStack.MyReservationDetails' }),
1574
+ CALL_TO_ACTION_PATH: (0, envalid_1.str)({ default: 'MainStack.GuestReservationRequestDetail' }),
1575
1575
  CALL_TO_ACTION_BOX_BGCOLOR: (0, envalid_1.str)({ default: '#0084ff' }),
1576
1576
  CALL_TO_ACTION_BUTTON_BORDERCOLOR: (0, envalid_1.str)({ default: '#fff' }),
1577
1577
  CALL_TO_ACTION_TEXT_COLOR: (0, envalid_1.str)({ default: '#fff' }),
@@ -1678,9 +1678,9 @@ const ConversationViewComponent = ({ channelId, role }) => {
1678
1678
  const [isShowImageViewer, setImageViewer] = (0, react_1.useState)(false);
1679
1679
  const [imageObject, setImageObject] = (0, react_1.useState)({});
1680
1680
  const isFocused = (0, native_1.useIsFocused)();
1681
- const { data: mongooseObjectId } = (0, platform_client_1.useGetNewMongooseObjectIdQuery)({
1681
+ const { data: mongooseObjectId, refetch: refetchNewPostId } = (0, platform_client_1.useGetNewMongooseObjectIdQuery)({
1682
1682
  fetchPolicy: 'network-only',
1683
- pollInterval: 5000,
1683
+ //pollInterval: 5000,
1684
1684
  });
1685
1685
  const { data: newMessage, loading: newMsgLoading, error: newMsgError, } = (0, platform_client_1.useOnChatMessageAddedSubscription)({
1686
1686
  variables: {
@@ -2055,7 +2055,7 @@ const ConversationViewComponent = ({ channelId, role }) => {
2055
2055
  // [setChannelMessages, currentUser, channelId, images,expoTokens],
2056
2056
  // );
2057
2057
  const handleSend = (0, react_1.useCallback)(async (message) => {
2058
- var _a;
2058
+ var _a, _b, _c;
2059
2059
  if (!channelId)
2060
2060
  return;
2061
2061
  if (!message && message != ' ' && images.length == 0)
@@ -2067,7 +2067,9 @@ const ConversationViewComponent = ({ channelId, role }) => {
2067
2067
  other: { sound: react_native_1.Platform.OS === 'android' ? false || null : 'default' },
2068
2068
  };
2069
2069
  if (images && images.length > 0) {
2070
- const postId = mongooseObjectId === null || mongooseObjectId === void 0 ? void 0 : mongooseObjectId.getNewMongooseObjectId;
2070
+ const newPostId = await refetchNewPostId();
2071
+ const postId = (_b = (_a = newPostId === null || newPostId === void 0 ? void 0 : newPostId.data) === null || _a === void 0 ? void 0 : _a.getNewMongooseObjectId) === null || _b === void 0 ? void 0 : _b.toString();
2072
+ // const postId: any = mongooseObjectId?.getNewMongooseObjectId;
2071
2073
  setLoading(true);
2072
2074
  const uploadResponse = await startUpload({
2073
2075
  file: images,
@@ -2090,7 +2092,7 @@ const ConversationViewComponent = ({ channelId, role }) => {
2090
2092
  setFiles([]);
2091
2093
  setImages([]);
2092
2094
  //setLoading(false);
2093
- const files = (_a = uploadedFiles === null || uploadedFiles === void 0 ? void 0 : uploadedFiles.map((f) => f.id)) !== null && _a !== void 0 ? _a : null;
2095
+ const files = (_c = uploadedFiles === null || uploadedFiles === void 0 ? void 0 : uploadedFiles.map((f) => f.id)) !== null && _c !== void 0 ? _c : null;
2094
2096
  await sendMsg({
2095
2097
  variables: {
2096
2098
  postId,
@@ -2875,9 +2877,9 @@ const ThreadConversationViewComponent = ({ channelId, postParentId, isPostParent
2875
2877
  const [parentId, setParentId] = (0, react_1.useState)(postParentId);
2876
2878
  const { startUpload } = (0, platform_client_1.useUploadFilesNative)();
2877
2879
  const [threadPost, setThreadPost] = (0, react_1.useState)([]);
2878
- const { data: mongooseObjectId } = (0, platform_client_1.useGetNewMongooseObjectIdQuery)({
2880
+ const { data: mongooseObjectId, refetch: refetchNewPostId } = (0, platform_client_1.useGetNewMongooseObjectIdQuery)({
2879
2881
  fetchPolicy: 'network-only',
2880
- pollInterval: 5000,
2882
+ // pollInterval: 5000,
2881
2883
  });
2882
2884
  const { data: newThreadMsg, loading: newThreadMsgLoading, error: newThreadMsgError, } = (0, platform_client_1.useOnThreadChatMessageAddedSubscription)({
2883
2885
  variables: {
@@ -3106,13 +3108,15 @@ const ThreadConversationViewComponent = ({ channelId, postParentId, isPostParent
3106
3108
  // const ObjectId = (m = Math, d = Date, h = 16, s = (s:any) => m.floor(s).toString(h)) =>
3107
3109
  // s(d.now() / 1000) + ' '.repeat(h).replace(/./g, () => s(m.random() * h))
3108
3110
  const handleSend = (0, react_1.useCallback)(async (message) => {
3109
- var _a;
3111
+ var _a, _b, _c;
3110
3112
  if (!channelId)
3111
3113
  return;
3112
3114
  if (!message && message != ' ' && images.length == 0)
3113
3115
  return;
3114
3116
  if (images && images.length > 0) {
3115
- const postId = mongooseObjectId === null || mongooseObjectId === void 0 ? void 0 : mongooseObjectId.getNewMongooseObjectId;
3117
+ const newPostId = await refetchNewPostId();
3118
+ const postId = (_b = (_a = newPostId === null || newPostId === void 0 ? void 0 : newPostId.data) === null || _a === void 0 ? void 0 : _a.getNewMongooseObjectId) === null || _b === void 0 ? void 0 : _b.toString();
3119
+ // const postId: any = mongooseObjectId?.getNewMongooseObjectId;
3116
3120
  setLoading(true);
3117
3121
  const uploadResponse = await startUpload({
3118
3122
  file: images,
@@ -3135,7 +3139,7 @@ const ThreadConversationViewComponent = ({ channelId, postParentId, isPostParent
3135
3139
  setFiles([]);
3136
3140
  setImages([]);
3137
3141
  //setLoading(false);
3138
- const files = (_a = uploadedFiles === null || uploadedFiles === void 0 ? void 0 : uploadedFiles.map((f) => f.id)) !== null && _a !== void 0 ? _a : null;
3142
+ const files = (_c = uploadedFiles === null || uploadedFiles === void 0 ? void 0 : uploadedFiles.map((f) => f.id)) !== null && _c !== void 0 ? _c : null;
3139
3143
  await sendThreadMessage({
3140
3144
  variables: {
3141
3145
  postId,