Skip to content

Commit

Permalink
fix: Merge branch 'main' into alpha-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammeds1992 committed Jul 19, 2023
2 parents a71302b + d56740f commit fe93d43
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/demoreact/src/app/ChatWidgetTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const ChatWidgetTest = () => {
(async()=>{
const user = await PushAPI.user.get({ account: account, env });
const pvtkey = null;
console.log(user)
if (user?.encryptedPrivateKey) {
const response = await PushAPI.chat.decryptPGPKey({
encryptedPGPPrivateKey: (user as IUser).encryptedPrivateKey,
Expand All @@ -35,6 +34,7 @@ export const ChatWidgetTest = () => {
const onClose = () => {
console.log('in here widget')
};

return (
<ChatAndNotificationWidget
account={account}
Expand Down
5 changes: 3 additions & 2 deletions packages/restapi/src/lib/chat/helpers/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ export const decryptConversation = async (options: DecryptConverationType) => {
} = options || {};
let otherPeer: IUser;
let signatureValidationPubliKey: string; // To do signature verification it depends on who has sent the message
for (let message of messages) {
for (let i = 0; i < messages.length; i++) {
const message = messages[i];
let gotOtherPeer = false;
if (message.encType !== 'PlainText') {
if (!pgpPrivateKey) {
Expand All @@ -182,7 +183,7 @@ export const decryptConversation = async (options: DecryptConverationType) => {
} else {
signatureValidationPubliKey = connectedUser.publicKey;
}
message = await decryptAndVerifyMessage(
messages[i] = await decryptAndVerifyMessage(
message,
signatureValidationPubliKey,
pgpPrivateKey
Expand Down
3 changes: 2 additions & 1 deletion packages/uiweb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"emoji-picker-react": "^4.4.9",
"html-react-parser": "^1.4.13",
"gif-picker-react": "^1.1.0",
"font-awesome": "^4.7.0"
"font-awesome": "^4.7.0",
"moment":"^2.29.4"
},
"peerDependencies": {
"@pushprotocol/restapi": "^1.2.15",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export const InboxNotificationFeedList = () => {
setPaginateLoading(false);
}
};

return (
<InboxNotifListCard
overflow="hidden auto"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const NotificationFeedList: React.FC<NotificationFeedListPropType> = ({
const { onSubscribeToChannel } = useOnSubscribeToChannel();
const { signer} = useContext<any>(ChatAndNotificationPropsContext);
const isSubscribedFn = (channel: string) => {
return subscriptionStatus.get(channel);
return !!subscriptionStatus.get(channel);
};
return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ const NotificationMainStateContextProvider = ({
const [spamNotifsFeed, setSpamNotifsFeed] = useState<NotificationFeedsType>(
{} as NotificationFeedsType
);
const [subscriptionStatus, setSubscriptionStatus] = useState<
Map<string, boolean>
>({} as Map<string, boolean>);
const [subscriptionStatus, setSubscriptionStatus] = useState<Map<string, boolean>>(new Map());
const [searchedNotifications, setSearchedNotifications] =
useState<NotificationFeedsType | null>(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const useFetchNotification = () => {
async ({ page,limit,spam =false}: fetchNotification) => {
setLoading(true);
try {
console.log(env)
const results = await PushAPI.user.getFeeds({
user: account, // user address in CAIP
raw: true,
Expand All @@ -33,7 +32,6 @@ const useFetchNotification = () => {
limit: limit
});
const parsedResponse = convertReponseToParsedArray(results);
console.log(parsedResponse)
const modifiedNotifObj = Object.fromEntries(
parsedResponse.map((e: any) => [`notif${e.sid}`, e])
);
Expand Down

0 comments on commit fe93d43

Please sign in to comment.