Skip to content

Commit

Permalink
Desktop: Allow marking sync errors as ignored in "sync status" (#10290)
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator committed Apr 10, 2024
1 parent 859d3e8 commit d2f3252
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions packages/app-desktop/gui/StatusScreen/StatusScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function StatusScreen(props: Props) {
flexDirection: 'column',
};

const retryStyle = { ...theme.urlStyle, marginLeft: 5 };
const inlineLinkStyle = { ...theme.urlStyle, marginLeft: 5 };
const retryAllStyle = { ...theme.urlStyle, marginTop: 5, display: 'inline-block' };

const containerPadding = theme.configScreenPadding;
Expand Down Expand Up @@ -107,17 +107,29 @@ function StatusScreen(props: Props) {
const item = section.body[n];
let text = '';

let ignoreLink = null;
let retryLink = null;
let itemType = null;
if (typeof item === 'object') {
if (item.canIgnore) {
const onClick = async () => {
await item.ignoreHandler();
void refreshScreen();
};
ignoreLink = (
<a href="#" onClick={onClick} style={inlineLinkStyle}>
{_('Ignore')}
</a>
);
}
if (item.canRetry) {
const onClick = async () => {
await item.retryHandler();
void refreshScreen();
};

retryLink = (
<a href="#" onClick={onClick} style={retryStyle}>
<a href="#" onClick={onClick} style={inlineLinkStyle}>
{_('Retry')}
</a>
);
Expand All @@ -142,18 +154,19 @@ function StatusScreen(props: Props) {

if (!text) text = '\xa0';

const actionLinks = <>{ignoreLink} {retryLink}</>;
if (currentListKey) {
listItems.push(
<li style={theme.textStyle} key={`item_${n}`}>
<span>{text}</span>
{retryLink}
{actionLinks}
</li>,
);
} else {
items.push(
<div style={theme.textStyle} key={`item_${n}`}>
<span>{text}</span>
{retryLink}
{actionLinks}
</div>,
);
}
Expand Down

0 comments on commit d2f3252

Please sign in to comment.