Skip to content

Commit

Permalink
broadcastChannelName -> electionChannelName
Browse files Browse the repository at this point in the history
  • Loading branch information
denysoblohin-okta committed Apr 24, 2022
1 parent 5fb2d92 commit 4770c86
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/ServiceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class ServiceManager implements ServiceManagerInterface {
const { autoRenew, autoRemove, syncStorage } = sdk.tokenManager.getOptions();
this.options = Object.assign({},
ServiceManager.defaultOptions,
{ autoRenew, autoRemove, syncStorage, broadcastChannelName: sdk.options.clientId },
{ autoRenew, autoRemove, syncStorage, electionChannelName: sdk.options.clientId },
options
);

Expand Down
4 changes: 2 additions & 2 deletions lib/services/LeaderElectionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export class LeaderElectionService implements ServiceInterface {
this.stop();
if (this.canStart()) {
if (!this.channel) {
const { broadcastChannelName } = this.options;
this.channel = new BroadcastChannel(broadcastChannelName as string);
const { electionChannelName } = this.options;
this.channel = new BroadcastChannel(electionChannelName as string);
}
if (!this.elector) {
this.elector = createLeaderElection(this.channel);
Expand Down
2 changes: 1 addition & 1 deletion lib/types/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface SyncStorageServiceOptions {
}

export interface LeaderElectionServiceOptions {
broadcastChannelName?: string;
electionChannelName?: string;
}

export type ServiceManagerOptions = AutoRenewServiceOptions &
Expand Down
2 changes: 1 addition & 1 deletion test/apps/app/src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Object.assign(window, {
syncStorage: config?.tokenManager?.syncStorage,
};
config.services = {
broadcastChannelName: config.clientId + '_crossTabTest'
electionChannelName: config.clientId + '_crossTabTest'
};
config.isTokenRenewPage = true;

Expand Down

0 comments on commit 4770c86

Please sign in to comment.