Skip to content

Commit 7317bf6

Browse files
authored
Refactor: make static attributes private (darkreader#7177)
1 parent 91b064d commit 7317bf6

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/background/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export class Extension {
4949
private startBarrier: PromiseBarrier<void, void> = null;
5050
private stateManager: StateManager<ExtensionState> = null;
5151

52-
static ALARM_NAME = 'auto-time-alarm';
53-
static LOCAL_STORAGE_KEY = 'Extension-state';
52+
private static ALARM_NAME = 'auto-time-alarm';
53+
private static LOCAL_STORAGE_KEY = 'Extension-state';
5454
constructor() {
5555
this.config = new ConfigManager();
5656
this.devtools = new DevTools(this.config, async () => this.onSettingsChanged());

src/background/newsmaker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ interface NewsmakerState {
1010
}
1111

1212
export default class Newsmaker {
13-
static UPDATE_INTERVAL = getDurationInMinutes({hours: 4});
14-
static ALARM_NAME = 'newsmaker';
15-
static LOCAL_STORAGE_KEY = 'Newsmaker-state';
13+
private static UPDATE_INTERVAL = getDurationInMinutes({hours: 4});
14+
private static ALARM_NAME = 'newsmaker';
15+
private static LOCAL_STORAGE_KEY = 'Newsmaker-state';
1616

1717
private stateManager: StateManager<NewsmakerState>;
1818
private latest: News[];

src/background/tab-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default class TabManager {
5555
private fileLoader: {get: (params: FetchRequestParameters) => Promise<string>} = null;
5656
private getTabMessage: (url: string, frameUrl: string) => Message;
5757
private timestamp: number = null;
58-
static LOCAL_STORAGE_KEY = 'TabManager-state';
58+
private static LOCAL_STORAGE_KEY = 'TabManager-state';
5959

6060
constructor({getConnectionMessage, onColorSchemeChange, getTabMessage}: TabManagerOptions) {
6161
this.stateManager = new StateManager<TabManagerState>(TabManager.LOCAL_STORAGE_KEY, this, {tabs: {}, timestamp: 0});

src/background/utils/network.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ interface CacheRecord {
7272

7373
class LimitedCacheStorage {
7474
// TODO: remove any cast once declarations are updated
75-
static QUOTA_BYTES = ((navigator as any).deviceMemory || 4) * 16 * 1024 * 1024;
76-
static TTL = getDuration({minutes: 10});
77-
static ALARM_NAME = 'network';
75+
private static QUOTA_BYTES = ((navigator as any).deviceMemory || 4) * 16 * 1024 * 1024;
76+
private static TTL = getDuration({minutes: 10});
77+
private static ALARM_NAME = 'network';
7878

7979
private bytesInUse = 0;
8080
private records = new Map<string, CacheRecord>();

0 commit comments

Comments
 (0)