Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shepherd-l committed Feb 16, 2024
1 parent a3b3253 commit c16e9bd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
14 changes: 7 additions & 7 deletions src/page/models/UserChangeEvent.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
type UserNamespaceProperties = {
onesignalId: string | undefined;
externalId: string | undefined;
};
onesignalId: string | undefined;
externalId: string | undefined;
};

type UserChangeEvent = {
current: UserNamespaceProperties;
};
type UserChangeEvent = {
current: UserNamespaceProperties;
};

export default UserChangeEvent;
export default UserChangeEvent;
11 changes: 6 additions & 5 deletions src/shared/helpers/EventHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,11 @@ export default class EventHelper {
}

static triggerUserChanged(change: UserChangeEvent) {
OneSignalEvent.trigger(OneSignal.EVENTS.SUBSCRIPTION_CHANGED, change, UserNamespace.emitter);
OneSignalEvent.trigger(
OneSignal.EVENTS.SUBSCRIPTION_CHANGED,
change,
UserNamespace.emitter,
);
}

static triggerNotificationClick(
Expand Down Expand Up @@ -326,10 +330,7 @@ export default class EventHelper {
OneSignalUtils.logMethodCall('checkAndTriggerUserChanged');

const userState = await Database.getUserState();
const {
previousOneSignalId,
previousExternalId,
} = userState;
const { previousOneSignalId, previousExternalId } = userState;

const identityModel = await OneSignal.coreDirector.getIdentityModel();
const currentOneSignalId = identityModel?.onesignalId;
Expand Down
4 changes: 2 additions & 2 deletions src/shared/services/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ export default class Database {

async getUserState(): Promise<UserState> {
const userState = new UserState();
userState.previousOneSignalId = "";
userState.previousExternalId = "";
userState.previousOneSignalId = '';
userState.previousExternalId = '';
// previous<OneSignalId|ExternalId> are used to track changes to the user's state.
// Displayed in the `current` & `previous` fields of the `userChange` event.
userState.previousOneSignalId = await this.get<string>(
Expand Down

0 comments on commit c16e9bd

Please sign in to comment.