Skip to content

Fix TODOs #1787

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

Merged
merged 1 commit into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/messaging/src/controllers/base-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,7 @@ export abstract class BaseController implements FirebaseMessaging {
* Returns the current Notification Permission state.
*/
getNotificationPermission_(): NotificationPermission {
// TODO: Remove the cast when this issue is fixed:
// https://github.com/Microsoft/TypeScript/issues/14701
// tslint:disable-next-line no-any
return (Notification as any).permission;
return Notification.permission;
}

getTokenDetailsModel(): TokenDetailsModel {
Expand Down
7 changes: 2 additions & 5 deletions packages/messaging/src/controllers/sw-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,8 @@ export class SwController extends BaseController {
const notificationTitle = notificationDetails.title || '';
const reg = await this.getSWRegistration_();

// TODO: Remove casts to any and redundant type declarations when this
// PR lands: https://github.com/Microsoft/TSJS-lib-generator/pull/438
// tslint:disable no-any
const actions: object[] = (notificationDetails as any).actions;
const maxActions: number | undefined = (Notification as any).maxActions;
const { actions } = notificationDetails;
const { maxActions } = Notification;
// tslint:enable no-any
if (actions && maxActions && actions.length > maxActions) {
console.warn(
Expand Down