Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(Notifications): Add methods for handling unread notifications #2469

Draft
wants to merge 2 commits into
base: refactor-and-feature/notification
Choose a base branch
from

Conversation

kunstefix
Copy link

Description

Issues that will be closed

Testing

Checklist

  • I have read the README document
  • I have read the CONTRIBUTING document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • My commit message follows Conventional Commit Guideline

this.initialize();
const subscriptions: Array<ChannelInfo> = await this._pushClient!.notification.subscriptions({
channel: this._akashaChannelAccount,
});
if (!subscriptions.length) throw new Error('There is no settings for this channel');
const channelSubscriptionInfo = subscriptions[0];
let userSettings: UserSetting[] = [];
let userSettings: unknown[] = [];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This interface didn't exist in original branch so i used unknown to temporarily fix error

Copy link

cloudflare-workers-and-pages bot commented Oct 30, 2024

Deploying akasha-core-framework with  Cloudflare Pages  Cloudflare Pages

Latest commit: e1461bd
Status: ✅  Deploy successful!
Preview URL: https://39367285.akasha-world-framework.pages.dev
Branch Preview URL: https://dev-407.akasha-world-framework.pages.dev

View logs

body: string;
title: string;
};
secret: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the props are mandatory?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't this be used as a ReturnType from the push sdk?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type they have in declaration file of sdk is any, so I created an interface for it manually.

@@ -19,6 +36,8 @@ class PushProtocol {
private _pushClient?: PushAPI;
private _notificationsStream?: PushStream;
private _akashaChannelAccount = '0x7Ebe714066149bEef3c2f60cC89eadF50Da23C26';
private _unreadNotifications: PushOrgNotification[] = [];
public readonly lastestSeenSidKey = 'lastestSeenSidKey';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be prefixed with the current authenticated did

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a method that prepends it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this contains also a typo, shouldn't it be latestSeen..?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants