chore: improve typings for bell elements#1397
Conversation
5185be8 to
ccdda15
Compare
ccdda15 to
1977249
Compare
| if (state.to === BellState._Subscribed) { | ||
| this.launcher.inactivate(); | ||
| } else if (state.to === Bell.STATES.UNSUBSCRIBED || Bell.STATES.BLOCKED) { | ||
| } else if (state.to === BellState._Unsubscribed || BellState._Blocked) { |
There was a problem hiding this comment.
Doesn't BellState._Blocked always evaluate to truthy? I'm not sure what this condition is trying to check for.
There was a problem hiding this comment.
Yeah its an exisiting, ill change it to state.to === BellState._Blocked
| return this.bell.badge.show(); | ||
| } else { | ||
| await Promise.all([super.inactivate(), this.resize('small')]); | ||
| return this; |
There was a problem hiding this comment.
I understand this is a refactor of existing code, but why does it either return badge.show() or this?
There was a problem hiding this comment.
Removed this, helpful for chaining but not really used
| .then(() => delay(MESSAGE_TIMEOUT)) | ||
| .then(() => this.message.hide()) | ||
| .then(() => { | ||
| if (this.launcher.wasInactive && this.dialog.hidden) { |
There was a problem hiding this comment.
Why is this condition changed to use a negative check but this line does the opposite?
There was a problem hiding this comment.
Line 302 is !this.dialog.hidden, there is a bang in front so it would be equivalent to shown.
There was a problem hiding this comment.
I understand that they're equivalent. I'm asking why the choice to use !this.dialog.shown instead of this.dialog.hidden here.
There was a problem hiding this comment.
We dont have this.dialog.hidden
| this.launcher.inactivate(); | ||
| } else if (state.to === Bell.STATES.UNSUBSCRIBED || Bell.STATES.BLOCKED) { | ||
| } else if (state.to === BellState._Unsubscribed || BellState._Blocked) { | ||
| this.launcher.activate(); |
There was a problem hiding this comment.
I don't know if it's intentional but I would double check that other instances of activate() need to be awaited
There was a problem hiding this comment.
Its in the emitter callback so awaiting wouldnt do anything from what I can tell
cb980ea to
fb5886c
Compare
fb5886c to
24abd6d
Compare
Description
1 Line Summary
Details
Systems Affected
Validation
Tests
Info
Checklist
Programming Checklist
Interfaces:
Functions:
Typescript:
Other:
elem of arraysyntax. PreferforEachor usemapcontextif possible. Instead, we can pass it to function/constructor so that we don't callOneSignal.contextScreenshots
Info
Checklist
Related Tickets
This change is