aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores
diff options
context:
space:
mode:
authorLibravatar Markus Hatvan <markus_hatvan@aon.at>2021-09-04 17:03:53 +0200
committerLibravatar GitHub <noreply@github.com>2021-09-04 17:03:53 +0200
commitf39cbe7d803245702885b308ab1cee4551aea9a1 (patch)
tree56d2e5dbe6242bb64b03ba5028b8bac39ea0c7ed /src/stores
parentUse namespaces when pulling docker base images since this is reqd for podman (diff)
downloadferdium-app-f39cbe7d803245702885b308ab1cee4551aea9a1.tar.gz
ferdium-app-f39cbe7d803245702885b308ab1cee4551aea9a1.tar.zst
ferdium-app-f39cbe7d803245702885b308ab1cee4551aea9a1.zip
chore: remove what's new functionality (#1864)
Diffstat (limited to 'src/stores')
-rw-r--r--src/stores/AppStore.js53
-rw-r--r--src/stores/FeaturesStore.js24
-rw-r--r--src/stores/index.ts4
3 files changed, 40 insertions, 41 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index cb8c71268..469e7519e 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -48,7 +48,8 @@ const autoLauncher = new AutoLaunch({
48 path: executablePath, 48 path: executablePath,
49}); 49});
50 50
51const CATALINA_NOTIFICATION_HACK_KEY = '_temp_askedForCatalinaNotificationPermissions'; 51const CATALINA_NOTIFICATION_HACK_KEY =
52 '_temp_askedForCatalinaNotificationPermissions';
52 53
53export default class AppStore extends Store { 54export default class AppStore extends Store {
54 updateStatusTypes = { 55 updateStatusTypes = {
@@ -92,8 +93,6 @@ export default class AppStore extends Store {
92 93
93 @observable isFocused = true; 94 @observable isFocused = true;
94 95
95 @observable nextAppReleaseVersion = null;
96
97 dictionaries = []; 96 dictionaries = [];
98 97
99 fetchDataInterval = null; 98 fetchDataInterval = null;
@@ -175,7 +174,6 @@ export default class AppStore extends Store {
175 ipcRenderer.on('autoUpdate', (event, data) => { 174 ipcRenderer.on('autoUpdate', (event, data) => {
176 if (data.available) { 175 if (data.available) {
177 this.updateStatus = this.updateStatusTypes.AVAILABLE; 176 this.updateStatus = this.updateStatusTypes.AVAILABLE;
178 this.nextAppReleaseVersion = data.version;
179 if (isMac) { 177 if (isMac) {
180 app.dock.bounce(); 178 app.dock.bounce();
181 } 179 }
@@ -236,8 +234,8 @@ export default class AppStore extends Store {
236 this.actions.service.resetLastPollTimer(); 234 this.actions.service.resetLastPollTimer();
237 235
238 if ( 236 if (
239 this.timeSuspensionStart.add(10, 'm').isBefore(moment()) 237 this.timeSuspensionStart.add(10, 'm').isBefore(moment()) &&
240 && this.stores.settings.app.get('reloadAfterResume') 238 this.stores.settings.app.get('reloadAfterResume')
241 ) { 239 ) {
242 debug('Reloading services, user info and features'); 240 debug('Reloading services, user info and features');
243 241
@@ -283,15 +281,15 @@ export default class AppStore extends Store {
283 ferdi: { 281 ferdi: {
284 version: ferdiVersion, 282 version: ferdiVersion,
285 electron: electronVersion, 283 electron: electronVersion,
286 installedRecipes: this.stores.recipes.all.map((recipe) => ({ 284 installedRecipes: this.stores.recipes.all.map(recipe => ({
287 id: recipe.id, 285 id: recipe.id,
288 version: recipe.version, 286 version: recipe.version,
289 })), 287 })),
290 devRecipes: this.stores.recipePreviews.dev.map((recipe) => ({ 288 devRecipes: this.stores.recipePreviews.dev.map(recipe => ({
291 id: recipe.id, 289 id: recipe.id,
292 version: recipe.version, 290 version: recipe.version,
293 })), 291 })),
294 services: this.stores.services.all.map((service) => ({ 292 services: this.stores.services.all.map(service => ({
295 id: service.id, 293 id: service.id,
296 recipe: service.recipe.id, 294 recipe: service.recipe.id,
297 isAttached: service.isAttached, 295 isAttached: service.isAttached,
@@ -302,7 +300,7 @@ export default class AppStore extends Store {
302 isDarkModeEnabled: service.isDarkModeEnabled, 300 isDarkModeEnabled: service.isDarkModeEnabled,
303 })), 301 })),
304 messages: this.stores.globalError.messages, 302 messages: this.stores.globalError.messages,
305 workspaces: this.stores.workspaces.workspaces.map((workspace) => ({ 303 workspaces: this.stores.workspaces.workspaces.map(workspace => ({
306 id: workspace.id, 304 id: workspace.id,
307 services: workspace.services, 305 services: workspace.services,
308 })), 306 })),
@@ -315,9 +313,7 @@ export default class AppStore extends Store {
315 } 313 }
316 314
317 // Actions 315 // Actions
318 @action _notify({ 316 @action _notify({ title, options, notificationId, serviceId = null }) {
319 title, options, notificationId, serviceId = null,
320 }) {
321 if (this.stores.settings.all.app.isAppMuted) return; 317 if (this.stores.settings.all.app.isAppMuted) return;
322 318
323 // TODO: is there a simple way to use blobs for notifications without storing them on disk? 319 // TODO: is there a simple way to use blobs for notifications without storing them on disk?
@@ -359,8 +355,8 @@ export default class AppStore extends Store {
359 if (indicator === 0 && unreadIndirectMessageCount !== 0) { 355 if (indicator === 0 && unreadIndirectMessageCount !== 0) {
360 indicator = '•'; 356 indicator = '•';
361 } else if ( 357 } else if (
362 unreadDirectMessageCount === 0 358 unreadDirectMessageCount === 0 &&
363 && unreadIndirectMessageCount === 0 359 unreadIndirectMessageCount === 0
364 ) { 360 ) {
365 indicator = 0; 361 indicator = 0;
366 } else { 362 } else {
@@ -441,22 +437,25 @@ export default class AppStore extends Store {
441 const clearAppCache = this.clearAppCacheRequest.execute(); 437 const clearAppCache = this.clearAppCacheRequest.execute();
442 const allServiceIds = await getServiceIdsFromPartitions(); 438 const allServiceIds = await getServiceIdsFromPartitions();
443 const allOrphanedServiceIds = allServiceIds.filter( 439 const allOrphanedServiceIds = allServiceIds.filter(
444 (id) => !this.stores.services.all.find( 440 id =>
445 (s) => id.replace('service-', '') === s.id, 441 !this.stores.services.all.find(
446 ), 442 s => id.replace('service-', '') === s.id,
443 ),
447 ); 444 );
448 445
449 try { 446 try {
450 await Promise.all( 447 await Promise.all(
451 allOrphanedServiceIds.map((id) => removeServicePartitionDirectory(id)), 448 allOrphanedServiceIds.map(id => removeServicePartitionDirectory(id)),
452 ); 449 );
453 } catch (ex) { 450 } catch (ex) {
454 console.log('Error while deleting service partition directory - ', ex); 451 console.log('Error while deleting service partition directory - ', ex);
455 } 452 }
456 await Promise.all( 453 await Promise.all(
457 this.stores.services.all.map((s) => this.actions.service.clearCache({ 454 this.stores.services.all.map(s =>
458 serviceId: s.id, 455 this.actions.service.clearCache({
459 })), 456 serviceId: s.id,
457 }),
458 ),
460 ); 459 );
461 460
462 await clearAppCache._promise; 461 await clearAppCache._promise;
@@ -488,9 +487,9 @@ export default class AppStore extends Store {
488 } 487 }
489 488
490 if ( 489 if (
491 locale 490 locale &&
492 && Object.prototype.hasOwnProperty.call(locales, locale) 491 Object.prototype.hasOwnProperty.call(locales, locale) &&
493 && locale !== this.locale 492 locale !== this.locale
494 ) { 493 ) {
495 this.locale = locale; 494 this.locale = locale;
496 } else if (!locale) { 495 } else if (!locale) {
@@ -568,8 +567,8 @@ export default class AppStore extends Store {
568 const dnd = await ipcRenderer.invoke('get-dnd'); 567 const dnd = await ipcRenderer.invoke('get-dnd');
569 debug('Do not disturb mode is', dnd); 568 debug('Do not disturb mode is', dnd);
570 if ( 569 if (
571 dnd !== this.stores.settings.all.app.isAppMuted 570 dnd !== this.stores.settings.all.app.isAppMuted &&
572 && !this.isSystemMuteOverridden 571 !this.isSystemMuteOverridden
573 ) { 572 ) {
574 this.actions.app.muteApp({ 573 this.actions.app.muteApp({
575 isMuted: dnd, 574 isMuted: dnd,
diff --git a/src/stores/FeaturesStore.js b/src/stores/FeaturesStore.js
index 0dff2fda2..1d50dd714 100644
--- a/src/stores/FeaturesStore.js
+++ b/src/stores/FeaturesStore.js
@@ -1,8 +1,4 @@
1import { 1import { computed, observable, runInAction } from 'mobx';
2 computed,
3 observable,
4 runInAction,
5} from 'mobx';
6 2
7import Store from './lib/Store'; 3import Store from './lib/Store';
8import CachedRequest from './lib/CachedRequest'; 4import CachedRequest from './lib/CachedRequest';
@@ -13,7 +9,6 @@ import workspaces from '../features/workspaces';
13import quickSwitch from '../features/quickSwitch'; 9import quickSwitch from '../features/quickSwitch';
14import nightlyBuilds from '../features/nightlyBuilds'; 10import nightlyBuilds from '../features/nightlyBuilds';
15import publishDebugInfo from '../features/publishDebugInfo'; 11import publishDebugInfo from '../features/publishDebugInfo';
16import announcements from '../features/announcements';
17import settingsWS from '../features/settingsWS'; 12import settingsWS from '../features/settingsWS';
18import communityRecipes from '../features/communityRecipes'; 13import communityRecipes from '../features/communityRecipes';
19import todos from '../features/todos'; 14import todos from '../features/todos';
@@ -22,11 +17,17 @@ import appearance from '../features/appearance';
22import { DEFAULT_FEATURES_CONFIG } from '../config'; 17import { DEFAULT_FEATURES_CONFIG } from '../config';
23 18
24export default class FeaturesStore extends Store { 19export default class FeaturesStore extends Store {
25 @observable defaultFeaturesRequest = new CachedRequest(this.api.features, 'default'); 20 @observable defaultFeaturesRequest = new CachedRequest(
21 this.api.features,
22 'default',
23 );
26 24
27 @observable featuresRequest = new CachedRequest(this.api.features, 'features'); 25 @observable featuresRequest = new CachedRequest(
26 this.api.features,
27 'features',
28 );
28 29
29 @observable features = ({ ...DEFAULT_FEATURES_CONFIG }); 30 @observable features = { ...DEFAULT_FEATURES_CONFIG };
30 31
31 async setup() { 32 async setup() {
32 this.registerReactions([ 33 this.registerReactions([
@@ -39,7 +40,9 @@ export default class FeaturesStore extends Store {
39 } 40 }
40 41
41 @computed get anonymousFeatures() { 42 @computed get anonymousFeatures() {
42 return this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG; 43 return (
44 this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG
45 );
43 } 46 }
44 47
45 _updateFeatures = () => { 48 _updateFeatures = () => {
@@ -72,7 +75,6 @@ export default class FeaturesStore extends Store {
72 quickSwitch(this.stores, this.actions); 75 quickSwitch(this.stores, this.actions);
73 nightlyBuilds(this.stores, this.actions); 76 nightlyBuilds(this.stores, this.actions);
74 publishDebugInfo(this.stores, this.actions); 77 publishDebugInfo(this.stores, this.actions);
75 announcements(this.stores, this.actions);
76 settingsWS(this.stores, this.actions); 78 settingsWS(this.stores, this.actions);
77 communityRecipes(this.stores, this.actions); 79 communityRecipes(this.stores, this.actions);
78 todos(this.stores, this.actions); 80 todos(this.stores, this.actions);
diff --git a/src/stores/index.ts b/src/stores/index.ts
index e980f2c5b..4cd4e92ea 100644
--- a/src/stores/index.ts
+++ b/src/stores/index.ts
@@ -10,7 +10,6 @@ import NewsStore from './NewsStore';
10import RequestStore from './RequestStore'; 10import RequestStore from './RequestStore';
11import GlobalErrorStore from './GlobalErrorStore'; 11import GlobalErrorStore from './GlobalErrorStore';
12import { workspaceStore } from '../features/workspaces'; 12import { workspaceStore } from '../features/workspaces';
13import { announcementsStore } from '../features/announcements';
14import { communityRecipesStore } from '../features/communityRecipes'; 13import { communityRecipesStore } from '../features/communityRecipes';
15import { todosStore } from '../features/todos'; 14import { todosStore } from '../features/todos';
16 15
@@ -30,13 +29,12 @@ export default (api, actions, router) => {
30 requests: new RequestStore(stores, api, actions), 29 requests: new RequestStore(stores, api, actions),
31 globalError: new GlobalErrorStore(stores, api, actions), 30 globalError: new GlobalErrorStore(stores, api, actions),
32 workspaces: workspaceStore, 31 workspaces: workspaceStore,
33 announcements: announcementsStore,
34 communityRecipes: communityRecipesStore, 32 communityRecipes: communityRecipesStore,
35 todos: todosStore, 33 todos: todosStore,
36 }); 34 });
37 35
38 // Initialize all stores 36 // Initialize all stores
39 Object.keys(stores).forEach((name) => { 37 Object.keys(stores).forEach(name => {
40 if (stores[name] && stores[name].initialize) { 38 if (stores[name] && stores[name].initialize) {
41 stores[name].initialize(); 39 stores[name].initialize();
42 } 40 }