Skip to content

Commit

Permalink
rm dead code getSubscriptionStateForInsecure
Browse files Browse the repository at this point in the history
  • Loading branch information
jkasten2 committed Nov 23, 2023
1 parent 0b05d94 commit 839d551
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/shared/managers/SubscriptionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,27 +883,6 @@ export class SubscriptionManager {
};
}

private async getSubscriptionStateForInsecure(): Promise<PushSubscriptionState> {
/* For HTTP, we need to rely on stored values; we never have access to the actual data */
const { deviceId, subscriptionToken, optedOut } =
await Database.getSubscription();
const notificationPermission =
await this.context.permissionManager.getNotificationPermission(
this.context.appConfig.safariWebId,
);

const isPushEnabled = !!(
deviceId &&
subscriptionToken &&
notificationPermission === NotificationPermission.Granted
);

return {
subscribed: isPushEnabled,
optedOut: !!optedOut,
};
}

/**
* Broadcasting to the server the fact user tried to subscribe but there was an error during service worker registration.
* Do it only once for the first page view.
Expand Down

0 comments on commit 839d551

Please sign in to comment.