Skip to content

Commit 3773994

Browse files
committed
fix clientType
1 parent 020e4f9 commit 3773994

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/client.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ export class Pushy {
8282
};
8383
})();
8484

85-
constructor(options: ClientOptions) {
85+
constructor(options: ClientOptions, clientType?: 'Pushy' | 'Cresc') {
8686
if (Platform.OS === 'ios' || Platform.OS === 'android') {
8787
if (!options.appKey) {
8888
throw new Error('appKey is required');
8989
}
9090
}
91-
this.clientType = new.target.name as 'Pushy' | 'Cresc';
91+
this.clientType = clientType || 'Pushy';
9292
this.options.server = SERVER_PRESETS[this.clientType];
9393
this.setOptions(options);
9494
if (isRolledBack) {
@@ -521,4 +521,8 @@ export class Pushy {
521521
}
522522

523523
// for international users
524-
export class Cresc extends Pushy {}
524+
export class Cresc extends Pushy {
525+
constructor(options: ClientOptions) {
526+
super(options, 'Cresc');
527+
}
528+
}

0 commit comments

Comments
 (0)