Optimize + refactor code

This commit is contained in:
redphx
2024-10-21 20:50:12 +07:00
parent 075b15aa48
commit de76364a46
44 changed files with 1794 additions and 1274 deletions

View File

@@ -50,6 +50,7 @@ enum StreamBadge {
export class StreamBadges {
private static instance: StreamBadges;
public static getInstance = () => StreamBadges.instance ?? (StreamBadges.instance = new StreamBadges());
private readonly LOG_TAG = 'StreamBadges';
private serverInfo: StreamServerInfo = {};
@@ -96,6 +97,10 @@ export class StreamBadges {
private intervalId?: number | null;
private readonly REFRESH_INTERVAL = 3 * 1000;
private constructor() {
BxLogger.info(this.LOG_TAG, 'constructor()');
}
setRegion(region: string) {
this.serverInfo.server = {
region: region,