@droppii-org/chat-mobile 0.2.102 → 0.2.103

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.
@@ -9,7 +9,11 @@ export const useResolveGroupInviteLink = code => {
9
9
  queryKey: groupQueryKeys.inviteInfo(code ?? ''),
10
10
  enabled: Boolean(code),
11
11
  queryFn: async () => {
12
- const res = await apiInstance?.get(ENDPOINTS.chatService.groupJoinLink(code));
12
+ // `code` may carry a "<nonce>/<realCode>" shape so repeated taps of the
13
+ // same invite link still produce a unique query key — strip the nonce
14
+ // back off before hitting the API.
15
+ const realCode = code.substring(code.lastIndexOf('/') + 1);
16
+ const res = await apiInstance?.get(ENDPOINTS.chatService.groupJoinLink(realCode));
13
17
  return unwrapEnvelope(res);
14
18
  },
15
19
  refetchOnWindowFocus: false
@@ -1 +1 @@
1
- {"version":3,"names":["useQuery","groupQueryKeys","apiInstance","unwrapEnvelope","ENDPOINTS","useResolveGroupInviteLink","code","queryKey","inviteInfo","enabled","Boolean","queryFn","res","get","chatService","groupJoinLink","refetchOnWindowFocus"],"sourceRoot":"../../../../src","sources":["hooks/groups/useResolveGroupInviteLink.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,cAAc,QAAQ,kBAAe;AAE9C,SAASC,WAAW,EAAEC,cAAc,QAAQ,wBAAqB;AAEjE,SAASC,SAAS,QAAQ,6BAA0B;AAEpD,OAAO,MAAMC,yBAAyB,GAAIC,IAAa,IAAK;EAC1D,OAAON,QAAQ,CAAC;IACdO,QAAQ,EAAEN,cAAc,CAACO,UAAU,CAACF,IAAI,IAAI,EAAE,CAAC;IAC/CG,OAAO,EAAEC,OAAO,CAACJ,IAAI,CAAC;IACtBK,OAAO,EAAE,MAAAA,CAAA,KAAY;MACnB,MAAMC,GAAG,GAAG,MAAMV,WAAW,EAAEW,GAAG,CAChCT,SAAS,CAACU,WAAW,CAACC,aAAa,CAACT,IAAK,CAC3C,CAAC;MACD,OAAOH,cAAc,CAAsBS,GAAG,CAAC;IACjD,CAAC;IACDI,oBAAoB,EAAE;EACxB,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useQuery","groupQueryKeys","apiInstance","unwrapEnvelope","ENDPOINTS","useResolveGroupInviteLink","code","queryKey","inviteInfo","enabled","Boolean","queryFn","realCode","substring","lastIndexOf","res","get","chatService","groupJoinLink","refetchOnWindowFocus"],"sourceRoot":"../../../../src","sources":["hooks/groups/useResolveGroupInviteLink.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,cAAc,QAAQ,kBAAe;AAE9C,SAASC,WAAW,EAAEC,cAAc,QAAQ,wBAAqB;AAEjE,SAASC,SAAS,QAAQ,6BAA0B;AAEpD,OAAO,MAAMC,yBAAyB,GAAIC,IAAa,IAAK;EAC1D,OAAON,QAAQ,CAAC;IACdO,QAAQ,EAAEN,cAAc,CAACO,UAAU,CAACF,IAAI,IAAI,EAAE,CAAC;IAC/CG,OAAO,EAAEC,OAAO,CAACJ,IAAI,CAAC;IACtBK,OAAO,EAAE,MAAAA,CAAA,KAAY;MACnB;MACA;MACA;MACA,MAAMC,QAAQ,GAAGN,IAAI,CAAEO,SAAS,CAACP,IAAI,CAAEQ,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;MAC5D,MAAMC,GAAG,GAAG,MAAMb,WAAW,EAAEc,GAAG,CAChCZ,SAAS,CAACa,WAAW,CAACC,aAAa,CAACN,QAAQ,CAC9C,CAAC;MACD,OAAOT,cAAc,CAAsBY,GAAG,CAAC;IACjD,CAAC;IACDI,oBAAoB,EAAE;EACxB,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useResolveGroupInviteLink.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useResolveGroupInviteLink.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK5D,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,wFAYtD,CAAC"}
1
+ {"version":3,"file":"useResolveGroupInviteLink.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/groups/useResolveGroupInviteLink.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAK5D,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,wFAgBtD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@droppii-org/chat-mobile",
3
- "version": "0.2.102",
3
+ "version": "0.2.103",
4
4
  "description": "Droppii chat mobile",
5
5
  "keywords": [
6
6
  "react-native",
@@ -10,8 +10,12 @@ export const useResolveGroupInviteLink = (code?: string) => {
10
10
  queryKey: groupQueryKeys.inviteInfo(code ?? ''),
11
11
  enabled: Boolean(code),
12
12
  queryFn: async () => {
13
+ // `code` may carry a "<nonce>/<realCode>" shape so repeated taps of the
14
+ // same invite link still produce a unique query key — strip the nonce
15
+ // back off before hitting the API.
16
+ const realCode = code!.substring(code!.lastIndexOf('/') + 1);
13
17
  const res = await apiInstance?.get<BaseResponse<GroupInviteLinkInfo>>(
14
- ENDPOINTS.chatService.groupJoinLink(code!)
18
+ ENDPOINTS.chatService.groupJoinLink(realCode)
15
19
  );
16
20
  return unwrapEnvelope<GroupInviteLinkInfo>(res);
17
21
  },