summaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/AppStore.ts32
-rw-r--r--src/stores/FeaturesStore.ts18
-rw-r--r--src/stores/GlobalErrorStore.ts10
-rw-r--r--src/stores/RecipePreviewsStore.ts10
-rw-r--r--src/stores/RecipesStore.ts14
-rw-r--r--src/stores/RequestStore.ts8
-rw-r--r--src/stores/ServicesStore.ts32
-rw-r--r--src/stores/SettingsStore.ts8
-rw-r--r--src/stores/UIStore.ts10
-rw-r--r--src/stores/UserStore.ts14
-rw-r--r--src/stores/index.ts24
-rw-r--r--src/stores/lib/CachedRequest.ts2
-rw-r--r--src/stores/lib/Reaction.ts2
-rw-r--r--src/stores/lib/Request.ts2
-rw-r--r--src/stores/lib/TypedStore.ts8
15 files changed, 97 insertions, 97 deletions
diff --git a/src/stores/AppStore.ts b/src/stores/AppStore.ts
index b8356bd56..b0a925411 100644
--- a/src/stores/AppStore.ts
+++ b/src/stores/AppStore.ts
@@ -1,46 +1,46 @@
1import { URL } from 'node:url'; 1import { URL } from 'node:url';
2import { ipcRenderer } from 'electron';
3import { 2import {
4 app, 3 app,
5 screen,
6 powerMonitor,
7 nativeTheme,
8 getCurrentWindow, 4 getCurrentWindow,
5 nativeTheme,
6 powerMonitor,
9 process as remoteProcess, 7 process as remoteProcess,
8 screen,
10} from '@electron/remote'; 9} from '@electron/remote';
10import AutoLaunch from 'auto-launch';
11import { ipcRenderer } from 'electron';
12import { readJsonSync } from 'fs-extra';
11import { action, computed, makeObservable, observable } from 'mobx'; 13import { action, computed, makeObservable, observable } from 'mobx';
12import moment from 'moment'; 14import moment from 'moment';
13import AutoLaunch from 'auto-launch';
14import ms from 'ms'; 15import ms from 'ms';
15import { readJsonSync } from 'fs-extra';
16 16
17import { Stores } from '../@types/stores.types'; 17import type { Stores } from '../@types/stores.types';
18import { ApiInterface } from '../api'; 18import type { Actions } from '../actions/lib/actions';
19import { Actions } from '../actions/lib/actions'; 19import type { ApiInterface } from '../api';
20import TypedStore from './lib/TypedStore';
21import Request from './lib/Request';
22import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; 20import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config';
23import { cleanseJSObject } from '../jsUtils';
24import { 21import {
22 electronVersion,
25 isMac, 23 isMac,
26 isWinPortable, 24 isWinPortable,
27 electronVersion,
28 osRelease, 25 osRelease,
29} from '../environment'; 26} from '../environment';
30import { 27import {
28 ferdiumLocale,
31 ferdiumVersion, 29 ferdiumVersion,
32 userDataPath, 30 userDataPath,
33 ferdiumLocale,
34} from '../environment-remote'; 31} from '../environment-remote';
35import generatedTranslations from '../i18n/translations';
36import { getLocale } from '../helpers/i18n-helpers'; 32import { getLocale } from '../helpers/i18n-helpers';
33import generatedTranslations from '../i18n/translations';
34import { cleanseJSObject } from '../jsUtils';
35import Request from './lib/Request';
36import TypedStore from './lib/TypedStore';
37 37
38import sleep from '../helpers/async-helpers';
38import { 39import {
39 getServiceIdsFromPartitions, 40 getServiceIdsFromPartitions,
40 removeServicePartitionDirectory, 41 removeServicePartitionDirectory,
41} from '../helpers/service-helpers'; 42} from '../helpers/service-helpers';
42import { openExternalUrl } from '../helpers/url-helpers'; 43import { openExternalUrl } from '../helpers/url-helpers';
43import sleep from '../helpers/async-helpers';
44 44
45const debug = require('../preload-safe-debug')('Ferdium:AppStore'); 45const debug = require('../preload-safe-debug')('Ferdium:AppStore');
46 46
diff --git a/src/stores/FeaturesStore.ts b/src/stores/FeaturesStore.ts
index 8584b6060..6167d0e22 100644
--- a/src/stores/FeaturesStore.ts
+++ b/src/stores/FeaturesStore.ts
@@ -5,18 +5,18 @@ import {
5 observable, 5 observable,
6 runInAction, 6 runInAction,
7} from 'mobx'; 7} from 'mobx';
8import { Stores } from '../@types/stores.types'; 8import type { Stores } from '../@types/stores.types';
9import { ApiInterface } from '../api'; 9import type { Actions } from '../actions/lib/actions';
10import { Actions } from '../actions/lib/actions'; 10import type { ApiInterface } from '../api';
11import CachedRequest from './lib/CachedRequest'; 11import appearance from '../features/appearance';
12import serviceProxy from '../features/serviceProxy';
13import basicAuth from '../features/basicAuth'; 12import basicAuth from '../features/basicAuth';
14import workspaces from '../features/workspaces';
15import quickSwitch from '../features/quickSwitch';
16import publishDebugInfo from '../features/publishDebugInfo';
17import communityRecipes from '../features/communityRecipes'; 13import communityRecipes from '../features/communityRecipes';
14import publishDebugInfo from '../features/publishDebugInfo';
15import quickSwitch from '../features/quickSwitch';
16import serviceProxy from '../features/serviceProxy';
18import todos from '../features/todos'; 17import todos from '../features/todos';
19import appearance from '../features/appearance'; 18import workspaces from '../features/workspaces';
19import CachedRequest from './lib/CachedRequest';
20import TypedStore from './lib/TypedStore'; 20import TypedStore from './lib/TypedStore';
21 21
22export default class FeaturesStore extends TypedStore { 22export default class FeaturesStore extends TypedStore {
diff --git a/src/stores/GlobalErrorStore.ts b/src/stores/GlobalErrorStore.ts
index 74a43100b..1da81eaa3 100644
--- a/src/stores/GlobalErrorStore.ts
+++ b/src/stores/GlobalErrorStore.ts
@@ -1,8 +1,8 @@
1import { observable, action, makeObservable } from 'mobx'; 1import type { Response } from 'electron';
2import { Response } from 'electron'; 2import { action, makeObservable, observable } from 'mobx';
3import { Actions } from '../actions/lib/actions'; 3import type { Stores } from '../@types/stores.types';
4import { ApiInterface } from '../api'; 4import type { Actions } from '../actions/lib/actions';
5import { Stores } from '../@types/stores.types'; 5import type { ApiInterface } from '../api';
6import Request from './lib/Request'; 6import Request from './lib/Request';
7import TypedStore from './lib/TypedStore'; 7import TypedStore from './lib/TypedStore';
8 8
diff --git a/src/stores/RecipePreviewsStore.ts b/src/stores/RecipePreviewsStore.ts
index 1c95e6b54..f851f3203 100644
--- a/src/stores/RecipePreviewsStore.ts
+++ b/src/stores/RecipePreviewsStore.ts
@@ -1,14 +1,14 @@
1import { action, computed, makeObservable, observable } from 'mobx'; 1import { action, computed, makeObservable, observable } from 'mobx';
2 2
3import { Actions } from '../actions/lib/actions'; 3import type { Stores } from '../@types/stores.types';
4import { ApiInterface } from '../api'; 4import type { Actions } from '../actions/lib/actions';
5import Recipe from '../models/Recipe'; 5import type { ApiInterface } from '../api';
6import { Stores } from '../@types/stores.types'; 6import type Recipe from '../models/Recipe';
7 7
8import type RecipePreview from '../models/RecipePreview';
8import CachedRequest from './lib/CachedRequest'; 9import CachedRequest from './lib/CachedRequest';
9import Request from './lib/Request'; 10import Request from './lib/Request';
10import TypedStore from './lib/TypedStore'; 11import TypedStore from './lib/TypedStore';
11import RecipePreview from '../models/RecipePreview';
12 12
13export default class RecipePreviewsStore extends TypedStore { 13export default class RecipePreviewsStore extends TypedStore {
14 @observable allRecipePreviewsRequest = new CachedRequest( 14 @observable allRecipePreviewsRequest = new CachedRequest(
diff --git a/src/stores/RecipesStore.ts b/src/stores/RecipesStore.ts
index 9b5565dcf..3cd81807a 100644
--- a/src/stores/RecipesStore.ts
+++ b/src/stores/RecipesStore.ts
@@ -1,15 +1,15 @@
1import { action, computed, makeObservable, observable } from 'mobx';
2import { readJSONSync } from 'fs-extra'; 1import { readJSONSync } from 'fs-extra';
2import { action, computed, makeObservable, observable } from 'mobx';
3import semver from 'semver'; 3import semver from 'semver';
4 4
5import Recipe from '../models/Recipe'; 5import type { Stores } from '../@types/stores.types';
6import { Stores } from '../@types/stores.types'; 6import type { Actions } from '../actions/lib/actions';
7import { ApiInterface } from '../api'; 7import type { ApiInterface } from '../api';
8import { Actions } from '../actions/lib/actions'; 8import { asarRecipesPath } from '../helpers/asar-helpers';
9import matchRoute from '../helpers/routing-helpers';
10import type Recipe from '../models/Recipe';
9import CachedRequest from './lib/CachedRequest'; 11import CachedRequest from './lib/CachedRequest';
10import Request from './lib/Request'; 12import Request from './lib/Request';
11import matchRoute from '../helpers/routing-helpers';
12import { asarRecipesPath } from '../helpers/asar-helpers';
13import TypedStore from './lib/TypedStore'; 13import TypedStore from './lib/TypedStore';
14 14
15const debug = require('../preload-safe-debug')('Ferdium:RecipeStore'); 15const debug = require('../preload-safe-debug')('Ferdium:RecipeStore');
diff --git a/src/stores/RequestStore.ts b/src/stores/RequestStore.ts
index 807f2d126..bad9f39ea 100644
--- a/src/stores/RequestStore.ts
+++ b/src/stores/RequestStore.ts
@@ -2,11 +2,11 @@ import { ipcRenderer } from 'electron';
2import { action, computed, makeObservable, observable } from 'mobx'; 2import { action, computed, makeObservable, observable } from 'mobx';
3import ms from 'ms'; 3import ms from 'ms';
4 4
5import { Actions } from '../actions/lib/actions'; 5import type { Stores } from '../@types/stores.types';
6import { ApiInterface } from '../api'; 6import type { Actions } from '../actions/lib/actions';
7import { Stores } from '../@types/stores.types'; 7import type { ApiInterface } from '../api';
8import CachedRequest from './lib/CachedRequest';
9import { LOCAL_HOSTNAME, LOCAL_PORT } from '../config'; 8import { LOCAL_HOSTNAME, LOCAL_PORT } from '../config';
9import type CachedRequest from './lib/CachedRequest';
10 10
11import TypedStore from './lib/TypedStore'; 11import TypedStore from './lib/TypedStore';
12 12
diff --git a/src/stores/ServicesStore.ts b/src/stores/ServicesStore.ts
index d7804a3fe..8105aa084 100644
--- a/src/stores/ServicesStore.ts
+++ b/src/stores/ServicesStore.ts
@@ -1,29 +1,29 @@
1import { join } from 'node:path'; 1import { join } from 'node:path';
2import { clipboard, ipcRenderer, shell } from 'electron'; 2import { clipboard, ipcRenderer, shell } from 'electron';
3import { action, reaction, computed, observable, makeObservable } from 'mobx'; 3import { ensureFileSync, pathExistsSync, writeFileSync } from 'fs-extra';
4import { debounce, remove } from 'lodash'; 4import { debounce, remove } from 'lodash';
5import { action, computed, makeObservable, observable, reaction } from 'mobx';
5import ms from 'ms'; 6import ms from 'ms';
6import { ensureFileSync, pathExistsSync, writeFileSync } from 'fs-extra';
7 7
8import { Stores } from '../@types/stores.types'; 8import type { Stores } from '../@types/stores.types';
9import { ApiInterface } from '../api'; 9import type { Actions } from '../actions/lib/actions';
10import { Actions } from '../actions/lib/actions'; 10import type { ApiInterface } from '../api';
11import Request from './lib/Request'; 11import { DEFAULT_SERVICE_SETTINGS, KEEP_WS_LOADED_USID } from '../config';
12import CachedRequest from './lib/CachedRequest'; 12import { ferdiumVersion } from '../environment-remote';
13import matchRoute from '../helpers/routing-helpers'; 13import { workspaceStore } from '../features/workspaces';
14import { isInTimeframe } from '../helpers/schedule-helpers';
15import { 14import {
16 getRecipeDirectory,
17 getDevRecipeDirectory, 15 getDevRecipeDirectory,
16 getRecipeDirectory,
18} from '../helpers/recipe-helpers'; 17} from '../helpers/recipe-helpers';
19import Service from '../models/Service'; 18import matchRoute from '../helpers/routing-helpers';
20import { workspaceStore } from '../features/workspaces'; 19import { isInTimeframe } from '../helpers/schedule-helpers';
21import { DEFAULT_SERVICE_SETTINGS, KEEP_WS_LOADED_USID } from '../config';
22import { cleanseJSObject } from '../jsUtils';
23import { SPELLCHECKER_LOCALES } from '../i18n/languages'; 20import { SPELLCHECKER_LOCALES } from '../i18n/languages';
24import { ferdiumVersion } from '../environment-remote'; 21import { cleanseJSObject } from '../jsUtils';
25import TypedStore from './lib/TypedStore';
26import type { UnreadServices } from '../lib/dbus/Ferdium'; 22import type { UnreadServices } from '../lib/dbus/Ferdium';
23import type Service from '../models/Service';
24import CachedRequest from './lib/CachedRequest';
25import Request from './lib/Request';
26import TypedStore from './lib/TypedStore';
27 27
28const debug = require('../preload-safe-debug')('Ferdium:ServiceStore'); 28const debug = require('../preload-safe-debug')('Ferdium:ServiceStore');
29 29
diff --git a/src/stores/SettingsStore.ts b/src/stores/SettingsStore.ts
index 010290a4a..72d6331cb 100644
--- a/src/stores/SettingsStore.ts
+++ b/src/stores/SettingsStore.ts
@@ -1,10 +1,10 @@
1import { ipcRenderer } from 'electron';
2import { getCurrentWindow } from '@electron/remote'; 1import { getCurrentWindow } from '@electron/remote';
2import { ipcRenderer } from 'electron';
3import { action, computed, makeObservable, observable, reaction } from 'mobx'; 3import { action, computed, makeObservable, observable, reaction } from 'mobx';
4import localStorage from 'mobx-localstorage'; 4import localStorage from 'mobx-localstorage';
5import { Stores } from '../@types/stores.types'; 5import type { Stores } from '../@types/stores.types';
6import { ApiInterface } from '../api'; 6import type { Actions } from '../actions/lib/actions';
7import { Actions } from '../actions/lib/actions'; 7import type { ApiInterface } from '../api';
8import { 8import {
9 DEFAULT_APP_SETTINGS, 9 DEFAULT_APP_SETTINGS,
10 FILE_SYSTEM_SETTINGS_TYPES, 10 FILE_SYSTEM_SETTINGS_TYPES,
diff --git a/src/stores/UIStore.ts b/src/stores/UIStore.ts
index a3330c2e6..614c16763 100644
--- a/src/stores/UIStore.ts
+++ b/src/stores/UIStore.ts
@@ -1,10 +1,10 @@
1import { action, observable, computed, reaction, makeObservable } from 'mobx';
2import { nativeTheme } from '@electron/remote'; 1import { nativeTheme } from '@electron/remote';
2import { action, computed, makeObservable, observable, reaction } from 'mobx';
3 3
4import { Stores } from '../@types/stores.types'; 4import type { Stores } from '../@types/stores.types';
5import { ApiInterface } from '../api'; 5import type { Actions } from '../actions/lib/actions';
6import { Actions } from '../actions/lib/actions'; 6import type { ApiInterface } from '../api';
7import { Theme, theme, ThemeType } from '../themes'; 7import { type Theme, ThemeType, theme } from '../themes';
8import TypedStore from './lib/TypedStore'; 8import TypedStore from './lib/TypedStore';
9 9
10export default class UIStore extends TypedStore { 10export default class UIStore extends TypedStore {
diff --git a/src/stores/UserStore.ts b/src/stores/UserStore.ts
index 9c3fcd3b9..ade68e4d4 100644
--- a/src/stores/UserStore.ts
+++ b/src/stores/UserStore.ts
@@ -1,16 +1,16 @@
1import { observable, computed, action, makeObservable } from 'mobx'; 1import { ipcRenderer } from 'electron';
2import moment from 'moment';
3import jwt from 'jsonwebtoken'; 2import jwt from 'jsonwebtoken';
3import { action, computed, makeObservable, observable } from 'mobx';
4import localStorage from 'mobx-localstorage'; 4import localStorage from 'mobx-localstorage';
5import { ipcRenderer } from 'electron'; 5import moment from 'moment';
6 6
7import { ApiInterface } from '../api'; 7import type { Stores } from '../@types/stores.types';
8import { Actions } from '../actions/lib/actions'; 8import type { Actions } from '../actions/lib/actions';
9import { Stores } from '../@types/stores.types'; 9import type { ApiInterface } from '../api';
10import { TODOS_PARTITION_ID } from '../config'; 10import { TODOS_PARTITION_ID } from '../config';
11import { isDevMode } from '../environment-remote'; 11import { isDevMode } from '../environment-remote';
12import Request from './lib/Request';
13import CachedRequest from './lib/CachedRequest'; 12import CachedRequest from './lib/CachedRequest';
13import Request from './lib/Request';
14import TypedStore from './lib/TypedStore'; 14import TypedStore from './lib/TypedStore';
15 15
16const debug = require('../preload-safe-debug')('Ferdium:UserStore'); 16const debug = require('../preload-safe-debug')('Ferdium:UserStore');
diff --git a/src/stores/index.ts b/src/stores/index.ts
index f9927d9a3..5b96e6efb 100644
--- a/src/stores/index.ts
+++ b/src/stores/index.ts
@@ -1,19 +1,19 @@
1import { RouterStore } from '@superwf/mobx-react-router'; 1import type { RouterStore } from '@superwf/mobx-react-router';
2import { ApiInterface } from '../api'; 2import type { Actions } from '../actions/lib/actions';
3import { Actions } from '../actions/lib/actions'; 3import type { ApiInterface } from '../api';
4import { communityRecipesStore } from '../features/communityRecipes';
5import { todosStore } from '../features/todos';
6import { workspaceStore } from '../features/workspaces';
4import AppStore from './AppStore'; 7import AppStore from './AppStore';
5import UserStore from './UserStore';
6import FeaturesStore from './FeaturesStore'; 8import FeaturesStore from './FeaturesStore';
7import SettingsStore from './SettingsStore'; 9import GlobalErrorStore from './GlobalErrorStore';
8import ServicesStore from './ServicesStore';
9import RecipesStore from './RecipesStore';
10import RecipePreviewsStore from './RecipePreviewsStore'; 10import RecipePreviewsStore from './RecipePreviewsStore';
11import UIStore from './UIStore'; 11import RecipesStore from './RecipesStore';
12import RequestStore from './RequestStore'; 12import RequestStore from './RequestStore';
13import GlobalErrorStore from './GlobalErrorStore'; 13import ServicesStore from './ServicesStore';
14import { workspaceStore } from '../features/workspaces'; 14import SettingsStore from './SettingsStore';
15import { communityRecipesStore } from '../features/communityRecipes'; 15import UIStore from './UIStore';
16import { todosStore } from '../features/todos'; 16import UserStore from './UserStore';
17 17
18export interface RealStores { 18export interface RealStores {
19 router: RouterStore; 19 router: RouterStore;
diff --git a/src/stores/lib/CachedRequest.ts b/src/stores/lib/CachedRequest.ts
index b24336fe6..3b15fcf3f 100644
--- a/src/stores/lib/CachedRequest.ts
+++ b/src/stores/lib/CachedRequest.ts
@@ -1,5 +1,5 @@
1import { action } from 'mobx';
2import { isEqual } from 'lodash'; 1import { isEqual } from 'lodash';
2import { action } from 'mobx';
3import Request from './Request'; 3import Request from './Request';
4 4
5export default class CachedRequest extends Request { 5export default class CachedRequest extends Request {
diff --git a/src/stores/lib/Reaction.ts b/src/stores/lib/Reaction.ts
index 3966c8073..d418d8db8 100644
--- a/src/stores/lib/Reaction.ts
+++ b/src/stores/lib/Reaction.ts
@@ -1,4 +1,4 @@
1import { autorun, IReactionDisposer, IReactionPublic } from 'mobx'; 1import { type IReactionDisposer, type IReactionPublic, autorun } from 'mobx';
2 2
3export default class Reaction { 3export default class Reaction {
4 public reaction: (r: IReactionPublic) => any; 4 public reaction: (r: IReactionPublic) => any;
diff --git a/src/stores/lib/Request.ts b/src/stores/lib/Request.ts
index 587af87d7..e7739bba1 100644
--- a/src/stores/lib/Request.ts
+++ b/src/stores/lib/Request.ts
@@ -1,4 +1,4 @@
1import { observable, action, computed, makeObservable } from 'mobx'; 1import { action, computed, makeObservable, observable } from 'mobx';
2 2
3// eslint-disable-next-line no-use-before-define 3// eslint-disable-next-line no-use-before-define
4type Hook = (request: Request) => void; 4type Hook = (request: Request) => void;
diff --git a/src/stores/lib/TypedStore.ts b/src/stores/lib/TypedStore.ts
index 8bae529ba..6d499b637 100644
--- a/src/stores/lib/TypedStore.ts
+++ b/src/stores/lib/TypedStore.ts
@@ -1,13 +1,13 @@
1import { 1import {
2 type IReactionPublic,
2 action, 3 action,
3 computed, 4 computed,
4 IReactionPublic,
5 makeObservable, 5 makeObservable,
6 observable, 6 observable,
7} from 'mobx'; 7} from 'mobx';
8import { Actions } from '../../actions/lib/actions'; 8import type { Stores } from '../../@types/stores.types';
9import { ApiInterface } from '../../api'; 9import type { Actions } from '../../actions/lib/actions';
10import { Stores } from '../../@types/stores.types'; 10import type { ApiInterface } from '../../api';
11import Reaction from './Reaction'; 11import Reaction from './Reaction';
12 12
13export default abstract class TypedStore { 13export default abstract class TypedStore {