Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
actual-vt-capstone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danieljk
actual-vt-capstone
Commits
4378489d
Unverified
Commit
4378489d
authored
1 year ago
by
Ziga Macele
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
[Bug]: darkmode regression - fatal error message is ugly (#1552)
parent
ca5977db
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/desktop-client/src/components/FatalError.tsx
+58
-65
58 additions, 65 deletions
packages/desktop-client/src/components/FatalError.tsx
upcoming-release-notes/1552.md
+6
-0
6 additions, 0 deletions
upcoming-release-notes/1552.md
with
64 additions
and
65 deletions
packages/desktop-client/src/components/FatalError.tsx
+
58
−
65
View file @
4378489d
import
React
,
{
useState
}
from
'
react
'
;
import
{
theme
}
from
'
../style
'
;
import
Block
from
'
./common/Block
'
;
import
Button
from
'
./common/Button
'
;
import
ExternalLink
from
'
./common/ExternalLink
'
;
...
...
@@ -24,7 +22,11 @@ type FatalErrorProps = {
error
:
Error
|
AppError
;
};
function
renderSimple
(
error
:
FatalErrorProps
[
'
error
'
])
{
type
RenderSimpleProps
=
{
error
:
Error
|
AppError
;
};
function
RenderSimple
({
error
}:
RenderSimpleProps
)
{
let
msg
;
if
(
'
IDBFailure
'
in
error
&&
error
.
IDBFailure
)
{
// IndexedDB wasn't able to open the database
...
...
@@ -76,33 +78,37 @@ function renderSimple(error: FatalErrorProps['error']) {
}
return
(
<
View
<
Stack
style
=
{
{
alignItems
:
'
center
'
,
justifyContent
:
'
center
'
,
height
:
'
100%
'
,
paddingBottom
:
15
,
lineHeight
:
'
1.5em
'
,
fontSize
:
15
,
}
}
>
<
Stack
style
=
{
{
paddingBottom
:
100
,
maxWidth
:
500
,
color
:
theme
.
errorText
,
backgroundColor
:
theme
.
errorBackground
,
lineHeight
:
'
1.5em
'
,
fontSize
:
15
,
}
}
>
<
Text
>
{
msg
}
</
Text
>
<
Text
>
Please get
{
'
'
}
<
ExternalLink
linkColor
=
"muted"
to
=
"https://actualbudget.org/contact"
>
in touch
</
ExternalLink
>
{
'
'
}
for support
</
Text
>
</
Stack
>
</
View
>
<
Text
>
{
msg
}
</
Text
>
<
Text
>
Please get
{
'
'
}
<
ExternalLink
linkColor
=
"muted"
to
=
"https://actualbudget.org/contact"
>
in touch
</
ExternalLink
>
{
'
'
}
for support
</
Text
>
</
Stack
>
);
}
function
RenderUIError
()
{
return
(
<>
<
Paragraph
>
There was an unrecoverable error in the UI. Sorry!
</
Paragraph
>
<
Paragraph
>
If this error persists, please get
{
'
'
}
<
ExternalLink
to
=
"https://actualbudget.org/contact"
>
in touch
</
ExternalLink
>
{
'
'
}
so it can be investigated.
</
Paragraph
>
</>
);
}
...
...
@@ -148,47 +154,34 @@ function SharedArrayBufferOverride() {
function
FatalError
({
buttonText
,
error
}:
FatalErrorProps
)
{
let
[
showError
,
setShowError
]
=
useState
(
false
);
if
(
'
type
'
in
error
&&
error
.
type
===
'
app-init-failure
'
)
{
return
renderSimple
(
error
);
}
const
showSimpleRender
=
'
type
'
in
error
&&
error
.
type
===
'
app-init-failure
'
;
return
(
<
Modal
isCurrent
=
{
true
}
showClose
=
{
false
}
title
=
"Fatal Error"
>
{
()
=>
(
<
View
style
=
{
{
maxWidth
:
500
}
}
>
<
Paragraph
>
There was an unrecoverable error in the UI. Sorry!
</
Paragraph
>
<
Paragraph
>
If this error persists, please get
{
'
'
}
<
ExternalLink
to
=
"https://actualbudget.org/contact"
>
in touch
</
ExternalLink
>
{
'
'
}
so it can be investigated.
</
Paragraph
>
<
Paragraph
>
<
Button
onClick
=
{
()
=>
window
.
Actual
.
relaunch
()
}
>
{
buttonText
}
</
Button
>
</
Paragraph
>
<
Paragraph
isLast
=
{
true
}
style
=
{
{
fontSize
:
11
}
}
>
<
LinkButton
onClick
=
{
()
=>
setShowError
(
true
)
}
>
Show Error
</
LinkButton
>
{
showError
&&
(
<
Block
style
=
{
{
marginTop
:
5
,
height
:
100
,
overflow
:
'
auto
'
,
}
}
>
{
error
.
stack
}
</
Block
>
)
}
</
Paragraph
>
</
View
>
)
}
<
View
style
=
{
{
maxWidth
:
500
,
}
}
>
{
showSimpleRender
?
<
RenderSimple
error
=
{
error
}
/>
:
<
RenderUIError
/>
}
<
Paragraph
>
<
Button
onClick
=
{
()
=>
window
.
Actual
.
relaunch
()
}
>
{
buttonText
}
</
Button
>
</
Paragraph
>
<
Paragraph
isLast
=
{
true
}
style
=
{
{
fontSize
:
11
}
}
>
<
LinkButton
onClick
=
{
()
=>
setShowError
(
true
)
}
>
Show Error
</
LinkButton
>
{
showError
&&
(
<
Block
style
=
{
{
marginTop
:
5
,
height
:
100
,
overflow
:
'
auto
'
,
}
}
>
{
error
.
stack
}
</
Block
>
)
}
</
Paragraph
>
</
View
>
</
Modal
>
);
}
...
...
This diff is collapsed.
Click to expand it.
upcoming-release-notes/1552.md
0 → 100644
+
6
−
0
View file @
4378489d
---
category
:
Bugfix
authors
:
[
zigamacele
]
---
Unified fatal error design
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment