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

[WIP] Notifications for New Matches #1610

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

[WIP] Notifications for New Matches #1610

wants to merge 12 commits into from

Conversation

albertcui
Copy link
Member

No description provided.

n.onclick = (event) => {
console.log(event);
event.preventDefault(); // prevent the browser from focusing the Notification's tab
window.open(`https://opendota.com/matches/${payload.data.match_id}`, '_blank');
Copy link
Member

Choose a reason for hiding this comment

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

Should the host be configurable?

const n = new Notification(
'Parsed $match'.replace('$match', payload.data.match_id),
{
body: 'Check out your performance.',
Copy link
Member

Choose a reason for hiding this comment

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

localize?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know how. I was going to ask you. Strings are only within App, and this is an event listener.

Copy link
Member

Choose a reason for hiding this comment

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

maybe you could mount this event listener within componentDidMount in App?

showLoginPrompt: true,
};

this.askForNotifiyPermission = this.askForNotifiyPermission.bind(this);
Copy link
Member

Choose a reason for hiding this comment

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

Notify

!user && this.state.showLoginPrompt ?
<Prompt>
<img src="/assets/images/icons/icon-72x72.png" alt="logo" style={{ height: '25px', margin: '0 5px' }} />
<h3 style={{ display: 'inline-block', margin: '0' }}>Get Tracked</h3>
Copy link
Member

Choose a reason for hiding this comment

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

"Get Tracked" may be poor phrasing with current concerns about data privacy

@@ -11,8 +11,7 @@ import store from './store';
import { getMetadata, getStrings, getAbilities, getNeutralAbilities, getAbilityIds } from './actions';
import App from './components/App';
import constants from './components/constants';
// import registerServiceWorker from './registerServiceWorker';
import { unregister } from './registerServiceWorker';
import registerServiceWorker from './registerServiceWorker';
Copy link
Member

Choose a reason for hiding this comment

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

we previously had issues with the default CRA service worker. not sure if that's still an issue

Copy link
Member

Choose a reason for hiding this comment

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

nvm looks like you changed the path to another SW. I would probably make a copy of that file and change the path there so we can enable the CRA service worker at some later point

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.

2 participants