Skip to content

Commit

Permalink
fix: some bugs (apache#6882)
Browse files Browse the repository at this point in the history
* fix: operator toast control error

* fix: adapt to small screen margins
  • Loading branch information
mintsweet committed Jan 26, 2024
1 parent 51a08ae commit 21eb4ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config-ui/src/routes/layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const Layout = () => {
</ExternalLink>
))}
</Header>
<Content style={{ margin: '16px auto', width: 1188 }}>
<Content style={{ margin: '16px auto', padding: '0 24px', width: 1188, boxSizing: 'border-box' }}>
<Outlet />
{!import.meta.env.DEVLAKE_COPYRIGHT_HIDE && (
<Footer>
Expand Down
4 changes: 2 additions & 2 deletions config-ui/src/utils/operator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ export const operator = async <T>(request: () => Promise<T>, config?: OperateCon
setOperating?.(true);
const res = await request();
const content = formatMessage?.() ?? 'Operation successfully completed';
if (!config?.hideToast || !config?.hideSuccessToast) {
if (!config?.hideToast && !config?.hideSuccessToast) {
message.success(content);
}
return [true, res];
} catch (err) {
console.error('Operation failed.', err);
const reason = formatReason?.(err) ?? (err as any).response?.data?.message ?? 'Operation failed.';
if (!config?.hideToast || !config?.hideErrorToast) {
if (!config?.hideToast && !config?.hideErrorToast) {
message.error(reason);
}

Expand Down

0 comments on commit 21eb4ca

Please sign in to comment.