aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2023-05-28 13:48:21 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2023-05-28 13:48:21 +0530
commit99ca310c73024b51fed1f3077375eed7827f2c20 (patch)
tree2bd15986f448129a2291acba90ccc6bf68a233e0 /src/stores
parentDisable in-app auto-updates for portable windows installation (fixes #1088) (... (diff)
downloadferdium-app-99ca310c73024b51fed1f3077375eed7827f2c20.tar.gz
ferdium-app-99ca310c73024b51fed1f3077375eed7827f2c20.tar.zst
ferdium-app-99ca310c73024b51fed1f3077375eed7827f2c20.zip
Fix issues reported by sonarqube linter
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/AppStore.ts4
-rw-r--r--src/stores/GlobalErrorStore.ts2
-rw-r--r--src/stores/ServicesStore.ts4
-rw-r--r--src/stores/UserStore.ts2
-rw-r--r--src/stores/index.ts2
5 files changed, 7 insertions, 7 deletions
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts
index 18b38799e..82591a2a4 100644
--- a/src/stores/AppStore.ts
+++ b/src/stores/AppStore.ts
@@ -212,7 +212,7 @@ export default class AppStore extends TypedStore {
212 } 212 }
213 213
214 if (data.error) { 214 if (data.error) {
215 if (data.error.message && data.error.message.startsWith('404')) { 215 if (data.error.message?.startsWith('404')) {
216 this.updateStatus = this.updateStatusTypes.NOT_AVAILABLE; 216 this.updateStatus = this.updateStatusTypes.NOT_AVAILABLE;
217 console.warn( 217 console.warn(
218 'Updater warning: there seems to be unpublished pre-release(s) available on GitHub', 218 'Updater warning: there seems to be unpublished pre-release(s) available on GitHub',
@@ -350,7 +350,7 @@ export default class AppStore extends TypedStore {
350 if (this.stores.settings.all.app.isAppMuted) return; 350 if (this.stores.settings.all.app.isAppMuted) return;
351 351
352 // TODO: is there a simple way to use blobs for notifications without storing them on disk? 352 // TODO: is there a simple way to use blobs for notifications without storing them on disk?
353 if (options.icon && options.icon.startsWith('blob:')) { 353 if (options.icon?.startsWith('blob:')) {
354 delete options.icon; 354 delete options.icon;
355 } 355 }
356 356
diff --git a/src/stores/GlobalErrorStore.ts b/src/stores/GlobalErrorStore.ts
index be86563d0..8547fec72 100644
--- a/src/stores/GlobalErrorStore.ts
+++ b/src/stores/GlobalErrorStore.ts
@@ -86,7 +86,7 @@ export default class GlobalErrorStore extends TypedStore {
86 if (request.isError) { 86 if (request.isError) {
87 this.error = request.error; 87 this.error = request.error;
88 88
89 if (request.error && request.error.json) { 89 if (request.error?.json) {
90 try { 90 try {
91 this.response = await request.error.json(); 91 this.response = await request.error.json();
92 } catch { 92 } catch {
diff --git a/src/stores/ServicesStore.ts b/src/stores/ServicesStore.ts
index 9c15d3a07..44f8b277c 100644
--- a/src/stores/ServicesStore.ts
+++ b/src/stores/ServicesStore.ts
@@ -425,12 +425,12 @@ export default class ServicesStore extends TypedStore {
425 return ( 425 return (
426 this.allDisplayed.find( 426 this.allDisplayed.find(
427 service => service.isTodosService && service.isEnabled, 427 service => service.isTodosService && service.isEnabled,
428 ) || false 428 ) ?? false
429 ); 429 );
430 } 430 }
431 431
432 @computed get isTodosServiceActive() { 432 @computed get isTodosServiceActive() {
433 return this.active && this.active.isTodosService; 433 return this.active?.isTodosService;
434 } 434 }
435 435
436 // TODO: This can actually return undefined as well 436 // TODO: This can actually return undefined as well
diff --git a/src/stores/UserStore.ts b/src/stores/UserStore.ts
index 6c8f8f20b..7ba8f4222 100644
--- a/src/stores/UserStore.ts
+++ b/src/stores/UserStore.ts
@@ -209,7 +209,7 @@ export default class UserStore extends TypedStore {
209 plan, 209 plan,
210 currency, 210 currency,
211 }): Promise<void> { 211 }): Promise<void> {
212 // TODO - [TS DEBT] Need to find a way proper to implement promise's then and catch in request class 212 // TODO: [TS DEBT] Need to find a way proper to implement promise's then and catch in request class
213 // @ts-ignore 213 // @ts-ignore
214 const authToken = await this.signupRequest.execute({ 214 const authToken = await this.signupRequest.execute({
215 firstname, 215 firstname,
diff --git a/src/stores/index.ts b/src/stores/index.ts
index 8836f2892..f9927d9a3 100644
--- a/src/stores/index.ts
+++ b/src/stores/index.ts
@@ -57,7 +57,7 @@ export default (
57 57
58 // Initialize all stores 58 // Initialize all stores
59 for (const name of Object.keys(stores)) { 59 for (const name of Object.keys(stores)) {
60 if (stores[name] && stores[name].initialize) { 60 if (stores[name]?.initialize) {
61 stores[name].initialize(); 61 stores[name].initialize();
62 } 62 }
63 } 63 }