From f39cbe7d803245702885b308ab1cee4551aea9a1 Mon Sep 17 00:00:00 2001 From: Markus Hatvan Date: Sat, 4 Sep 2021 17:03:53 +0200 Subject: chore: remove what's new functionality (#1864) --- src/stores/AppStore.js | 53 ++++++++++++++++++++++----------------------- src/stores/FeaturesStore.js | 24 ++++++++++---------- src/stores/index.ts | 4 +--- 3 files changed, 40 insertions(+), 41 deletions(-) (limited to 'src/stores') 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({ path: executablePath, }); -const CATALINA_NOTIFICATION_HACK_KEY = '_temp_askedForCatalinaNotificationPermissions'; +const CATALINA_NOTIFICATION_HACK_KEY = + '_temp_askedForCatalinaNotificationPermissions'; export default class AppStore extends Store { updateStatusTypes = { @@ -92,8 +93,6 @@ export default class AppStore extends Store { @observable isFocused = true; - @observable nextAppReleaseVersion = null; - dictionaries = []; fetchDataInterval = null; @@ -175,7 +174,6 @@ export default class AppStore extends Store { ipcRenderer.on('autoUpdate', (event, data) => { if (data.available) { this.updateStatus = this.updateStatusTypes.AVAILABLE; - this.nextAppReleaseVersion = data.version; if (isMac) { app.dock.bounce(); } @@ -236,8 +234,8 @@ export default class AppStore extends Store { this.actions.service.resetLastPollTimer(); if ( - this.timeSuspensionStart.add(10, 'm').isBefore(moment()) - && this.stores.settings.app.get('reloadAfterResume') + this.timeSuspensionStart.add(10, 'm').isBefore(moment()) && + this.stores.settings.app.get('reloadAfterResume') ) { debug('Reloading services, user info and features'); @@ -283,15 +281,15 @@ export default class AppStore extends Store { ferdi: { version: ferdiVersion, electron: electronVersion, - installedRecipes: this.stores.recipes.all.map((recipe) => ({ + installedRecipes: this.stores.recipes.all.map(recipe => ({ id: recipe.id, version: recipe.version, })), - devRecipes: this.stores.recipePreviews.dev.map((recipe) => ({ + devRecipes: this.stores.recipePreviews.dev.map(recipe => ({ id: recipe.id, version: recipe.version, })), - services: this.stores.services.all.map((service) => ({ + services: this.stores.services.all.map(service => ({ id: service.id, recipe: service.recipe.id, isAttached: service.isAttached, @@ -302,7 +300,7 @@ export default class AppStore extends Store { isDarkModeEnabled: service.isDarkModeEnabled, })), messages: this.stores.globalError.messages, - workspaces: this.stores.workspaces.workspaces.map((workspace) => ({ + workspaces: this.stores.workspaces.workspaces.map(workspace => ({ id: workspace.id, services: workspace.services, })), @@ -315,9 +313,7 @@ export default class AppStore extends Store { } // Actions - @action _notify({ - title, options, notificationId, serviceId = null, - }) { + @action _notify({ title, options, notificationId, serviceId = null }) { if (this.stores.settings.all.app.isAppMuted) return; // 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 { if (indicator === 0 && unreadIndirectMessageCount !== 0) { indicator = '•'; } else if ( - unreadDirectMessageCount === 0 - && unreadIndirectMessageCount === 0 + unreadDirectMessageCount === 0 && + unreadIndirectMessageCount === 0 ) { indicator = 0; } else { @@ -441,22 +437,25 @@ export default class AppStore extends Store { const clearAppCache = this.clearAppCacheRequest.execute(); const allServiceIds = await getServiceIdsFromPartitions(); const allOrphanedServiceIds = allServiceIds.filter( - (id) => !this.stores.services.all.find( - (s) => id.replace('service-', '') === s.id, - ), + id => + !this.stores.services.all.find( + s => id.replace('service-', '') === s.id, + ), ); try { await Promise.all( - allOrphanedServiceIds.map((id) => removeServicePartitionDirectory(id)), + allOrphanedServiceIds.map(id => removeServicePartitionDirectory(id)), ); } catch (ex) { console.log('Error while deleting service partition directory - ', ex); } await Promise.all( - this.stores.services.all.map((s) => this.actions.service.clearCache({ - serviceId: s.id, - })), + this.stores.services.all.map(s => + this.actions.service.clearCache({ + serviceId: s.id, + }), + ), ); await clearAppCache._promise; @@ -488,9 +487,9 @@ export default class AppStore extends Store { } if ( - locale - && Object.prototype.hasOwnProperty.call(locales, locale) - && locale !== this.locale + locale && + Object.prototype.hasOwnProperty.call(locales, locale) && + locale !== this.locale ) { this.locale = locale; } else if (!locale) { @@ -568,8 +567,8 @@ export default class AppStore extends Store { const dnd = await ipcRenderer.invoke('get-dnd'); debug('Do not disturb mode is', dnd); if ( - dnd !== this.stores.settings.all.app.isAppMuted - && !this.isSystemMuteOverridden + dnd !== this.stores.settings.all.app.isAppMuted && + !this.isSystemMuteOverridden ) { this.actions.app.muteApp({ 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 @@ -import { - computed, - observable, - runInAction, -} from 'mobx'; +import { computed, observable, runInAction } from 'mobx'; import Store from './lib/Store'; import CachedRequest from './lib/CachedRequest'; @@ -13,7 +9,6 @@ import workspaces from '../features/workspaces'; import quickSwitch from '../features/quickSwitch'; import nightlyBuilds from '../features/nightlyBuilds'; import publishDebugInfo from '../features/publishDebugInfo'; -import announcements from '../features/announcements'; import settingsWS from '../features/settingsWS'; import communityRecipes from '../features/communityRecipes'; import todos from '../features/todos'; @@ -22,11 +17,17 @@ import appearance from '../features/appearance'; import { DEFAULT_FEATURES_CONFIG } from '../config'; export default class FeaturesStore extends Store { - @observable defaultFeaturesRequest = new CachedRequest(this.api.features, 'default'); + @observable defaultFeaturesRequest = new CachedRequest( + this.api.features, + 'default', + ); - @observable featuresRequest = new CachedRequest(this.api.features, 'features'); + @observable featuresRequest = new CachedRequest( + this.api.features, + 'features', + ); - @observable features = ({ ...DEFAULT_FEATURES_CONFIG }); + @observable features = { ...DEFAULT_FEATURES_CONFIG }; async setup() { this.registerReactions([ @@ -39,7 +40,9 @@ export default class FeaturesStore extends Store { } @computed get anonymousFeatures() { - return this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG; + return ( + this.defaultFeaturesRequest.execute().result || DEFAULT_FEATURES_CONFIG + ); } _updateFeatures = () => { @@ -72,7 +75,6 @@ export default class FeaturesStore extends Store { quickSwitch(this.stores, this.actions); nightlyBuilds(this.stores, this.actions); publishDebugInfo(this.stores, this.actions); - announcements(this.stores, this.actions); settingsWS(this.stores, this.actions); communityRecipes(this.stores, this.actions); 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'; import RequestStore from './RequestStore'; import GlobalErrorStore from './GlobalErrorStore'; import { workspaceStore } from '../features/workspaces'; -import { announcementsStore } from '../features/announcements'; import { communityRecipesStore } from '../features/communityRecipes'; import { todosStore } from '../features/todos'; @@ -30,13 +29,12 @@ export default (api, actions, router) => { requests: new RequestStore(stores, api, actions), globalError: new GlobalErrorStore(stores, api, actions), workspaces: workspaceStore, - announcements: announcementsStore, communityRecipes: communityRecipesStore, todos: todosStore, }); // Initialize all stores - Object.keys(stores).forEach((name) => { + Object.keys(stores).forEach(name => { if (stores[name] && stores[name].initialize) { stores[name].initialize(); } -- cgit v1.2.3-70-g09d2