Skip to content

Commit

Permalink
Remove variable
Browse files Browse the repository at this point in the history
  • Loading branch information
shepherd-l committed Sep 13, 2024
1 parent 7a2bcf7 commit 3f6459a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/CoreModuleDirector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ export class CoreModuleDirector {
const modelStores = this.getModelStores();

subscriptions.forEach(async (subscription) => {
const modelName = ModelName.Subscriptions;
/* We use the token to identify the model because the subscription ID is not set until the server responds.
* So when we initially hydrate after init, we may already have a push model with a token, but no ID.
* We don't want to create a new model in this case, so we use the token to identify the model.
Expand All @@ -136,12 +135,15 @@ export class CoreModuleDirector {
}
existingSubscription.hydrate(subscription);
} else {
const model = new OSModel<SupportedModel>(modelName, subscription);
const model = new OSModel<SupportedModel>(
ModelName.Subscriptions,
subscription,
);
model.setOneSignalId(onesignalId);
if (externalId) {
model?.setExternalId(externalId);
}
modelStores[modelName].add(model, false); // don't propagate to server
modelStores[ModelName.Subscriptions].add(model, false); // don't propagate to server
}
});
}
Expand Down

0 comments on commit 3f6459a

Please sign in to comment.