diff options
author | Vijay A <avijayr@protonmail.com> | 2021-08-11 18:50:42 +0530 |
---|---|---|
committer | Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com> | 2021-08-11 13:38:04 +0000 |
commit | 11c2b649388687570851fcb58ab59f5daaa3f194 (patch) | |
tree | 257acfbcc42e542978b67a1e4edccc87ca0be4a6 | |
parent | 5.6.1-nightly.22 [skip ci] (diff) | |
download | ferdium-app-11c2b649388687570851fcb58ab59f5daaa3f194.tar.gz ferdium-app-11c2b649388687570851fcb58ab59f5daaa3f194.tar.zst ferdium-app-11c2b649388687570851fcb58ab59f5daaa3f194.zip |
revert: fixing #1757 by commenting out partial fix
- Fixes issue with ferdi not starting up.
- Also adds some defensive checks for the same code in other
repeated locations.
-rw-r--r-- | packages/forms/src/button/index.tsx | 2 | ||||
-rw-r--r-- | packages/forms/src/select/index.tsx | 2 | ||||
-rw-r--r-- | packages/forms/src/toggle/index.tsx | 2 | ||||
-rw-r--r-- | packages/ui/src/infobox/index.tsx | 15 | ||||
-rw-r--r-- | src/components/auth/SetupAssistant.js | 2 | ||||
-rw-r--r-- | src/components/layout/AppLayout.js | 2 | ||||
-rw-r--r-- | src/components/services/content/ConnectionLostBanner.js | 2 | ||||
-rw-r--r-- | src/components/services/tabs/TabItem.js | 2 | ||||
-rw-r--r-- | src/components/ui/AppLoader/styles.js | 2 | ||||
-rw-r--r-- | src/features/webControls/components/WebControls.js | 2 | ||||
-rw-r--r-- | src/features/workspaces/components/WorkspaceDrawerItem.js | 2 | ||||
-rw-r--r-- | src/features/workspaces/components/WorkspaceSwitchingIndicator.js | 2 |
12 files changed, 19 insertions, 18 deletions
diff --git a/packages/forms/src/button/index.tsx b/packages/forms/src/button/index.tsx index 0aef04a6c..48fb61635 100644 --- a/packages/forms/src/button/index.tsx +++ b/packages/forms/src/button/index.tsx | |||
@@ -38,7 +38,7 @@ interface IProps extends IFormField, IWithStyle { | |||
38 | let buttonTransition: string = 'none'; | 38 | let buttonTransition: string = 'none'; |
39 | let loaderContainerTransition: string = 'none'; | 39 | let loaderContainerTransition: string = 'none'; |
40 | 40 | ||
41 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 41 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
42 | buttonTransition = 'background .5s, opacity 0.3s'; | 42 | buttonTransition = 'background .5s, opacity 0.3s'; |
43 | loaderContainerTransition = 'all 0.3s'; | 43 | loaderContainerTransition = 'all 0.3s'; |
44 | } | 44 | } |
diff --git a/packages/forms/src/select/index.tsx b/packages/forms/src/select/index.tsx index ef3e70ddb..d7479f63e 100644 --- a/packages/forms/src/select/index.tsx +++ b/packages/forms/src/select/index.tsx | |||
@@ -49,7 +49,7 @@ interface IState { | |||
49 | let popupTransition: string = 'none'; | 49 | let popupTransition: string = 'none'; |
50 | let toggleTransition: string = 'none'; | 50 | let toggleTransition: string = 'none'; |
51 | 51 | ||
52 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 52 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
53 | popupTransition = 'all 0.3s'; | 53 | popupTransition = 'all 0.3s'; |
54 | toggleTransition = 'transform 0.3s'; | 54 | toggleTransition = 'transform 0.3s'; |
55 | } | 55 | } |
diff --git a/packages/forms/src/toggle/index.tsx b/packages/forms/src/toggle/index.tsx index e525d2906..bdf1d22cf 100644 --- a/packages/forms/src/toggle/index.tsx +++ b/packages/forms/src/toggle/index.tsx | |||
@@ -19,7 +19,7 @@ interface IProps | |||
19 | 19 | ||
20 | let buttonTransition: string = 'none'; | 20 | let buttonTransition: string = 'none'; |
21 | 21 | ||
22 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 22 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
23 | buttonTransition = 'all .5s'; | 23 | buttonTransition = 'all .5s'; |
24 | } | 24 | } |
25 | 25 | ||
diff --git a/packages/ui/src/infobox/index.tsx b/packages/ui/src/infobox/index.tsx index a6e4b3240..88cfdb620 100644 --- a/packages/ui/src/infobox/index.tsx +++ b/packages/ui/src/infobox/index.tsx | |||
@@ -44,13 +44,14 @@ const buttonStyles = (theme: Theme) => { | |||
44 | return styles; | 44 | return styles; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | let infoBoxTransition: string = 'none'; | 47 | const infoBoxTransition: string = 'none'; |
48 | let ctaTransition: string = 'none'; | 48 | const ctaTransition: string = 'none'; |
49 | 49 | ||
50 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 50 | // TODO: Not sure why, but this location alone, the `dinwo` is not defined - and it throws an error thus aborting the startup sequence of ferdi |
51 | infoBoxTransition = 'all 0.5s'; | 51 | // if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
52 | ctaTransition = 'opacity 0.3s'; | 52 | // infoBoxTransition = 'all 0.5s'; |
53 | } | 53 | // ctaTransition = 'opacity 0.3s'; |
54 | // } | ||
54 | 55 | ||
55 | const styles = (theme: Theme) => ({ | 56 | const styles = (theme: Theme) => ({ |
56 | wrapper: { | 57 | wrapper: { |
diff --git a/src/components/auth/SetupAssistant.js b/src/components/auth/SetupAssistant.js index 06ab09892..0f821d4fc 100644 --- a/src/components/auth/SetupAssistant.js +++ b/src/components/auth/SetupAssistant.js | |||
@@ -37,7 +37,7 @@ const messages = defineMessages({ | |||
37 | 37 | ||
38 | let transition = 'none'; | 38 | let transition = 'none'; |
39 | 39 | ||
40 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 40 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
41 | transition = 'all 0.25s'; | 41 | transition = 'all 0.25s'; |
42 | } | 42 | } |
43 | 43 | ||
diff --git a/src/components/layout/AppLayout.js b/src/components/layout/AppLayout.js index de962cc12..d5e1deb39 100644 --- a/src/components/layout/AppLayout.js +++ b/src/components/layout/AppLayout.js | |||
@@ -47,7 +47,7 @@ const messages = defineMessages({ | |||
47 | 47 | ||
48 | let transition = 'none'; | 48 | let transition = 'none'; |
49 | 49 | ||
50 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 50 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
51 | transition = 'transform 0.5s ease'; | 51 | transition = 'transform 0.5s ease'; |
52 | } | 52 | } |
53 | 53 | ||
diff --git a/src/components/services/content/ConnectionLostBanner.js b/src/components/services/content/ConnectionLostBanner.js index 343ddf8b4..ebe863333 100644 --- a/src/components/services/content/ConnectionLostBanner.js +++ b/src/components/services/content/ConnectionLostBanner.js | |||
@@ -26,7 +26,7 @@ const messages = defineMessages({ | |||
26 | 26 | ||
27 | let buttonTransition = 'none'; | 27 | let buttonTransition = 'none'; |
28 | 28 | ||
29 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 29 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
30 | buttonTransition = 'opacity 0.25s'; | 30 | buttonTransition = 'opacity 0.25s'; |
31 | } | 31 | } |
32 | 32 | ||
diff --git a/src/components/services/tabs/TabItem.js b/src/components/services/tabs/TabItem.js index 023e152c7..d4a4048eb 100644 --- a/src/components/services/tabs/TabItem.js +++ b/src/components/services/tabs/TabItem.js | |||
@@ -72,7 +72,7 @@ let pollIndicatorTransition = 'none'; | |||
72 | let polledTransition = 'none'; | 72 | let polledTransition = 'none'; |
73 | let pollAnsweredTransition = 'none'; | 73 | let pollAnsweredTransition = 'none'; |
74 | 74 | ||
75 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 75 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
76 | pollIndicatorTransition = 'background 0.5s'; | 76 | pollIndicatorTransition = 'background 0.5s'; |
77 | polledTransition = 'background 0.1s'; | 77 | polledTransition = 'background 0.1s'; |
78 | pollAnsweredTransition = 'background 0.1s'; | 78 | pollAnsweredTransition = 'background 0.1s'; |
diff --git a/src/components/ui/AppLoader/styles.js b/src/components/ui/AppLoader/styles.js index 011f6282d..9891e0387 100644 --- a/src/components/ui/AppLoader/styles.js +++ b/src/components/ui/AppLoader/styles.js | |||
@@ -1,6 +1,6 @@ | |||
1 | let sloganTransition = 'none'; | 1 | let sloganTransition = 'none'; |
2 | 2 | ||
3 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 3 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
4 | sloganTransition = 'opacity 1s ease'; | 4 | sloganTransition = 'opacity 1s ease'; |
5 | } | 5 | } |
6 | 6 | ||
diff --git a/src/features/webControls/components/WebControls.js b/src/features/webControls/components/WebControls.js index 417ebb0b0..9a95eb2d2 100644 --- a/src/features/webControls/components/WebControls.js +++ b/src/features/webControls/components/WebControls.js | |||
@@ -38,7 +38,7 @@ const messages = defineMessages({ | |||
38 | 38 | ||
39 | let buttonTransition = 'none'; | 39 | let buttonTransition = 'none'; |
40 | 40 | ||
41 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 41 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
42 | buttonTransition = 'opacity 0.25s'; | 42 | buttonTransition = 'opacity 0.25s'; |
43 | } | 43 | } |
44 | 44 | ||
diff --git a/src/features/workspaces/components/WorkspaceDrawerItem.js b/src/features/workspaces/components/WorkspaceDrawerItem.js index c3f9fcb19..f08e87bd7 100644 --- a/src/features/workspaces/components/WorkspaceDrawerItem.js +++ b/src/features/workspaces/components/WorkspaceDrawerItem.js | |||
@@ -20,7 +20,7 @@ const messages = defineMessages({ | |||
20 | 20 | ||
21 | let itemTransition = 'none'; | 21 | let itemTransition = 'none'; |
22 | 22 | ||
23 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 23 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
24 | itemTransition = 'background-color 300ms ease-out'; | 24 | itemTransition = 'background-color 300ms ease-out'; |
25 | } | 25 | } |
26 | 26 | ||
diff --git a/src/features/workspaces/components/WorkspaceSwitchingIndicator.js b/src/features/workspaces/components/WorkspaceSwitchingIndicator.js index 613075c4a..c8ec0bc4c 100644 --- a/src/features/workspaces/components/WorkspaceSwitchingIndicator.js +++ b/src/features/workspaces/components/WorkspaceSwitchingIndicator.js | |||
@@ -17,7 +17,7 @@ const messages = defineMessages({ | |||
17 | 17 | ||
18 | let wrapperTransition = 'none'; | 18 | let wrapperTransition = 'none'; |
19 | 19 | ||
20 | if (window.matchMedia('(prefers-reduced-motion: no-preference)')) { | 20 | if (window && window.matchMedia('(prefers-reduced-motion: no-preference)')) { |
21 | wrapperTransition = 'width 0.5s ease'; | 21 | wrapperTransition = 'width 0.5s ease'; |
22 | } | 22 | } |
23 | 23 | ||