diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2023-12-22 15:12:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-22 15:12:16 -0700 |
commit | 85927dc191a935761b3f175bcd50e7c3076acc9e (patch) | |
tree | ceeb350621d824eeb9fdc9137a64a2e820b269b9 /src/stores | |
parent | Reset nightly version to 6.7.1-nightly.0 (diff) | |
download | ferdium-app-85927dc191a935761b3f175bcd50e7c3076acc9e.tar.gz ferdium-app-85927dc191a935761b3f175bcd50e7c3076acc9e.tar.zst ferdium-app-85927dc191a935761b3f175bcd50e7c3076acc9e.zip |
refactor: remove unused code with knip (#1492)
- remove unused code snippets flagged by `npx knip`
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.ts | 2 | ||||
-rw-r--r-- | src/stores/SettingsStore.ts | 6 | ||||
-rw-r--r-- | src/stores/UserStore.ts | 27 | ||||
-rw-r--r-- | src/stores/lib/Request.ts | 9 |
4 files changed, 0 insertions, 44 deletions
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts index 9af0a9a4f..b8c980dea 100644 --- a/src/stores/AppStore.ts +++ b/src/stores/AppStore.ts | |||
@@ -126,8 +126,6 @@ export default class AppStore extends TypedStore { | |||
126 | 126 | ||
127 | @observable launchInBackground = DEFAULT_APP_SETTINGS.autoLaunchInBackground; | 127 | @observable launchInBackground = DEFAULT_APP_SETTINGS.autoLaunchInBackground; |
128 | 128 | ||
129 | dictionaries = []; | ||
130 | |||
131 | fetchDataInterval: NodeJS.Timeout | null = null; | 129 | fetchDataInterval: NodeJS.Timeout | null = null; |
132 | 130 | ||
133 | @observable downloads: Download[] = []; | 131 | @observable downloads: Download[] = []; |
diff --git a/src/stores/SettingsStore.ts b/src/stores/SettingsStore.ts index 90cd82690..2e8568134 100644 --- a/src/stores/SettingsStore.ts +++ b/src/stores/SettingsStore.ts | |||
@@ -11,17 +11,11 @@ import { | |||
11 | LOCAL_SERVER, | 11 | LOCAL_SERVER, |
12 | } from '../config'; | 12 | } from '../config'; |
13 | import { hash } from '../helpers/password-helpers'; | 13 | import { hash } from '../helpers/password-helpers'; |
14 | import Request from './lib/Request'; | ||
15 | import TypedStore from './lib/TypedStore'; | 14 | import TypedStore from './lib/TypedStore'; |
16 | 15 | ||
17 | const debug = require('../preload-safe-debug')('Ferdium:SettingsStore'); | 16 | const debug = require('../preload-safe-debug')('Ferdium:SettingsStore'); |
18 | 17 | ||
19 | export default class SettingsStore extends TypedStore { | 18 | export default class SettingsStore extends TypedStore { |
20 | @observable updateAppSettingsRequest = new Request( | ||
21 | this.api.local, | ||
22 | 'updateAppSettings', | ||
23 | ); | ||
24 | |||
25 | @observable loaded: boolean = false; | 19 | @observable loaded: boolean = false; |
26 | 20 | ||
27 | fileSystemSettingsTypes = FILE_SYSTEM_SETTINGS_TYPES; | 21 | fileSystemSettingsTypes = FILE_SYSTEM_SETTINGS_TYPES; |
diff --git a/src/stores/UserStore.ts b/src/stores/UserStore.ts index f98f7d340..9c3fcd3b9 100644 --- a/src/stores/UserStore.ts +++ b/src/stores/UserStore.ts | |||
@@ -60,11 +60,6 @@ export default class UserStore extends TypedStore { | |||
60 | 'updateInfo', | 60 | 'updateInfo', |
61 | ); | 61 | ); |
62 | 62 | ||
63 | @observable getLegacyServicesRequest: CachedRequest = new CachedRequest( | ||
64 | this.api.user, | ||
65 | 'getLegacyServices', | ||
66 | ); | ||
67 | |||
68 | @observable deleteAccountRequest: CachedRequest = new CachedRequest( | 63 | @observable deleteAccountRequest: CachedRequest = new CachedRequest( |
69 | this.api.user, | 64 | this.api.user, |
70 | 'delete', | 65 | 'delete', |
@@ -93,8 +88,6 @@ export default class UserStore extends TypedStore { | |||
93 | 88 | ||
94 | @observable logoutReason: string | null = null; | 89 | @observable logoutReason: string | null = null; |
95 | 90 | ||
96 | fetchUserInfoInterval = null; | ||
97 | |||
98 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { | 91 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { |
99 | super(stores, api, actions); | 92 | super(stores, api, actions); |
100 | 93 | ||
@@ -132,26 +125,10 @@ export default class UserStore extends TypedStore { | |||
132 | return this.LOGIN_ROUTE; | 125 | return this.LOGIN_ROUTE; |
133 | } | 126 | } |
134 | 127 | ||
135 | get logoutRoute(): string { | ||
136 | return this.LOGOUT_ROUTE; | ||
137 | } | ||
138 | |||
139 | get signupRoute(): string { | 128 | get signupRoute(): string { |
140 | return this.SIGNUP_ROUTE; | 129 | return this.SIGNUP_ROUTE; |
141 | } | 130 | } |
142 | 131 | ||
143 | get setupRoute(): string { | ||
144 | return this.SETUP_ROUTE; | ||
145 | } | ||
146 | |||
147 | get inviteRoute(): string { | ||
148 | return this.INVITE_ROUTE; | ||
149 | } | ||
150 | |||
151 | get importRoute(): string { | ||
152 | return this.IMPORT_ROUTE; | ||
153 | } | ||
154 | |||
155 | get passwordRoute(): string { | 132 | get passwordRoute(): string { |
156 | return this.PASSWORD_ROUTE; | 133 | return this.PASSWORD_ROUTE; |
157 | } | 134 | } |
@@ -191,10 +168,6 @@ export default class UserStore extends TypedStore { | |||
191 | return this.data.team || null; | 168 | return this.data.team || null; |
192 | } | 169 | } |
193 | 170 | ||
194 | @computed get legacyServices(): any { | ||
195 | return this.getLegacyServicesRequest.execute() || {}; | ||
196 | } | ||
197 | |||
198 | // Actions | 171 | // Actions |
199 | @action async _login({ email, password }): Promise<void> { | 172 | @action async _login({ email, password }): Promise<void> { |
200 | const authToken = await this.loginRequest.execute(email, password).promise; | 173 | const authToken = await this.loginRequest.execute(email, password).promise; |
diff --git a/src/stores/lib/Request.ts b/src/stores/lib/Request.ts index 911c5ccfb..587af87d7 100644 --- a/src/stores/lib/Request.ts +++ b/src/stores/lib/Request.ts | |||
@@ -1,5 +1,4 @@ | |||
1 | import { observable, action, computed, makeObservable } from 'mobx'; | 1 | import { observable, action, computed, makeObservable } from 'mobx'; |
2 | import { isEqual } from 'lodash/fp'; | ||
3 | 2 | ||
4 | // eslint-disable-next-line no-use-before-define | 3 | // eslint-disable-next-line no-use-before-define |
5 | type Hook = (request: Request) => void; | 4 | type Hook = (request: Request) => void; |
@@ -123,14 +122,6 @@ export default class Request { | |||
123 | return this.execute(...args); | 122 | return this.execute(...args); |
124 | } | 123 | } |
125 | 124 | ||
126 | isExecutingWithArgs(...args: any[]): boolean { | ||
127 | return ( | ||
128 | this.isExecuting && | ||
129 | this.currentApiCall && | ||
130 | isEqual(this.currentApiCall.args, args) | ||
131 | ); | ||
132 | } | ||
133 | |||
134 | @computed get isExecutingFirstTime(): boolean { | 125 | @computed get isExecutingFirstTime(): boolean { |
135 | return !this.wasExecuted && this.isExecuting; | 126 | return !this.wasExecuted && this.isExecuting; |
136 | } | 127 | } |