Skip to content

Commit

Permalink
Fix/bugs (#555)
Browse files Browse the repository at this point in the history
* fix: fixed subscription status bug

* fix: added moment in dependecy
  • Loading branch information
mishramonalisha76 authored Jul 18, 2023
1 parent ab01717 commit d56740f
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 9 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
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 d56740f

Please sign in to comment.