From f65231268dd9df273104b0ef9bfe0dc1da571c46 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 15 Jul 2021 08:26:50 +0100 Subject: [PATCH 1/2] Cache value of feature_spaces* flags as they cause page refresh so are immutable --- src/vector/platform/ElectronPlatform.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index 574891e86dc..cef3812d647 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -50,7 +50,7 @@ import { showToast as showUpdateToast } from "matrix-react-sdk/src/toasts/Update import { CheckUpdatesPayload } from "matrix-react-sdk/src/dispatcher/payloads/CheckUpdatesPayload"; import ToastStore from "matrix-react-sdk/src/stores/ToastStore"; import GenericExpiringToast from "matrix-react-sdk/src/components/views/toasts/GenericExpiringToast"; -import SettingsStore from 'matrix-react-sdk/src/settings/SettingsStore'; +import SpaceStore from "matrix-react-sdk/src/stores/SpaceStore"; import { IMatrixProfile, IEventWithRoomId as IMatrixEvent, IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; import VectorBasePlatform from './VectorBasePlatform'; @@ -600,7 +600,7 @@ export default class ElectronPlatform extends VectorBasePlatform { case "8": case "9": case "0": - if (SettingsStore.getValue("feature_spaces") && isOnlyCtrlOrCmdKeyEvent(ev)) { + if (SpaceStore.spacesEnabled && isOnlyCtrlOrCmdKeyEvent(ev)) { this.navigateToSpace(parseInt(ev.key, 10)); handled = true; } From 2877ef8fcfa3e0fbc11fc68aefd01b4b5ad9ddcb Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 15 Jul 2021 08:29:18 +0100 Subject: [PATCH 2/2] Fix skinning --- src/vector/platform/ElectronPlatform.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index cef3812d647..848ac724df4 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -50,7 +50,7 @@ import { showToast as showUpdateToast } from "matrix-react-sdk/src/toasts/Update import { CheckUpdatesPayload } from "matrix-react-sdk/src/dispatcher/payloads/CheckUpdatesPayload"; import ToastStore from "matrix-react-sdk/src/stores/ToastStore"; import GenericExpiringToast from "matrix-react-sdk/src/components/views/toasts/GenericExpiringToast"; -import SpaceStore from "matrix-react-sdk/src/stores/SpaceStore"; +import SettingsStore from 'matrix-react-sdk/src/settings/SettingsStore'; import { IMatrixProfile, IEventWithRoomId as IMatrixEvent, IResultRoomEvents } from "matrix-js-sdk/src/@types/search"; import VectorBasePlatform from './VectorBasePlatform'; @@ -600,7 +600,9 @@ export default class ElectronPlatform extends VectorBasePlatform { case "8": case "9": case "0": - if (SpaceStore.spacesEnabled && isOnlyCtrlOrCmdKeyEvent(ev)) { + // ideally we would use SpaceStore.spacesEnabled here but importing SpaceStore in this platform + // breaks skinning as the platform is instantiated prior to the skin being loaded + if (SettingsStore.getValue("feature_spaces") && isOnlyCtrlOrCmdKeyEvent(ev)) { this.navigateToSpace(parseInt(ev.key, 10)); handled = true; }