Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.

Commit b754416

Browse files
committed
cleanup
1 parent 65c85bb commit b754416

File tree

5 files changed

+17
-19
lines changed

5 files changed

+17
-19
lines changed

src/constants.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { SyncStorageKey } from '../types/enums';
22

33
// NB! If these need changing, also update manifest.json
4-
export const LEETIFY_API_DOMAIN = 'api.leetify.com';
5-
export const LEETIFY_FRONTEND_DOMAIN = 'leetify.com';
6-
export const LEETIFY_API_URL = `https://${LEETIFY_API_DOMAIN}`;
7-
export const LEETIFY_FRONTEND_URL = `https://${LEETIFY_FRONTEND_DOMAIN}`;
4+
export const LEETIFY_API_URL = 'https://api.leetify.com';
5+
export const LEETIFY_FRONTEND_URL = 'https://leetify.com';
86

97
export const getOptionDefaults = () => ({
108
[SyncStorageKey.OPTION_SYNC_UNRANKED_WINGMAN]: true,

src/gcpd.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Gcpd {
1515
return this.fetchMatchesRecursively({ tab, previouslyFoundMatchTimestamp, matches: [] });
1616
}
1717

18-
private async fetchMatchesRecursively({
18+
protected async fetchMatchesRecursively({
1919
continueToken,
2020
depth,
2121
matches,

src/leetify-access-token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class LeetifyAccessToken {
1919
});
2020

2121
const leetifyAccessToken = await this.leetifyAccessTokenPromise;
22-
this.leetifyAccessTokenPromise = null;
22+
this.clearPromise();
2323
await chrome.offscreen.closeDocument();
2424

2525
return leetifyAccessToken;

src/match-sync.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,6 @@ class MatchSync {
3838
}
3939
}
4040

41-
protected async initDomParser(): Promise<void> {
42-
await this.setStatus({ status: SyncStatus.GCPD_PARSER_INITIALIZING });
43-
44-
await chrome.offscreen.createDocument({
45-
justification: 'Parse Steam GCPD page',
46-
reasons: ['DOM_PARSER'],
47-
url: 'src/offscreen/dom-parser.html',
48-
});
49-
50-
await this.setStatus({ status: SyncStatus.GCPD_PARSER_INITIALIZED });
51-
}
52-
5341
public async setStatus(eventBody: SyncStatusEventBody): Promise<void> {
5442
if (eventBody.status === SyncStatus.DONE) {
5543
this.lastStatusEventBody = { status: SyncStatus.IDLE };
@@ -78,6 +66,18 @@ class MatchSync {
7866
await chrome.runtime.sendMessage({ event: EventName.SYNC_STATUS, data: this.lastStatusEventBody });
7967
}
8068

69+
protected async initDomParser(): Promise<void> {
70+
await this.setStatus({ status: SyncStatus.GCPD_PARSER_INITIALIZING });
71+
72+
await chrome.offscreen.createDocument({
73+
justification: 'Parse Steam GCPD page',
74+
reasons: ['DOM_PARSER'],
75+
url: 'src/offscreen/dom-parser.html',
76+
});
77+
78+
await this.setStatus({ status: SyncStatus.GCPD_PARSER_INITIALIZED });
79+
}
80+
8181
protected async syncAllMatches(leetifyAccessToken: string): Promise<boolean> {
8282
const scrimmageSuccessful = await this.syncMatches(GcpdTab.SCRIMMAGE, leetifyAccessToken);
8383
if (!scrimmageSuccessful) return false;

src/view-tab.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ViewTab {
1919
});
2020
}
2121

22-
public async exists(): Promise<boolean> {
22+
protected async exists(): Promise<boolean> {
2323
if (!this.tab?.id) return false;
2424

2525
if (!await tabExists(this.tab.id)) {

0 commit comments

Comments
 (0)