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

Add notification manager for web #128

Closed
wants to merge 7 commits into from
Closed

Add notification manager for web #128

wants to merge 7 commits into from

Conversation

JSMonk
Copy link
Member

@JSMonk JSMonk commented May 17, 2024

No description provided.

@@ -82,11 +82,11 @@ fun SearchScreen(
selectedTab = it
}
)
Row(horizontalArrangement = Arrangement.End, modifier = Modifier.fillMaxWidth()) {
Row(horizontalArrangement = Arrangement.Start, modifier = Modifier.fillMaxWidth()) {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like it affects the mobile design as well. Should it be platform specific?

Copy link
Member

Choose a reason for hiding this comment

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

btw. UI changes should not be related to the notification manager

actual fun requestPermission() {
Notification.requestPermission {
if (it == "granted") {
notificationAllowed = true
Copy link
Member

Choose a reason for hiding this comment

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

Notification will be shown only on the first open, after reopen/refresh notificationAllowed will be false.

Copy link
Member Author

@JSMonk JSMonk May 20, 2024

Choose a reason for hiding this comment

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

As far as I remember, it should be saved by the browser for a specific host

Copy link
Member

Choose a reason for hiding this comment

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

But it's runtime value, and it will not be persisted between runs

actual class NotificationManager actual constructor(
context: ApplicationContext
) {
private var notificationAllowed = false
Copy link
Member

@bashor bashor May 20, 2024

Choose a reason for hiding this comment

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

It should be initialized using Notification.permission

bashor and others added 5 commits May 20, 2024 16:01
* Don't use paths relative to root since on GitHub it's not located in the root

* Remove non-existed files from urls to cache

* Add missed files to urls to cache
@JSMonk JSMonk temporarily deployed to github-pages May 20, 2024 14:11 — with GitHub Actions Inactive
@bashor
Copy link
Member

bashor commented May 21, 2024

Pushed Notification related things to the master without UI changes

@bashor bashor closed this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants