Skip to content

Commit

Permalink
fix(#28): place newest notifications on top
Browse files Browse the repository at this point in the history
  • Loading branch information
notmedia committed Dec 6, 2022
1 parent 9542dc1 commit ade02cf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/components/notification/notification-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'react-toastify/dist/ReactToastify.css';

const StyledToastContainer = styled(ToastContainer, {
position: 'fixed',
height: '95vh',
zIndex: '$max',
'.Toastify__toast-theme--dark': {
backgroundColor: '$backgroundContrast !important',
Expand All @@ -23,6 +22,7 @@ export const NotificationContainer: React.FC = () => {
pauseOnFocusLoss
pauseOnHover
closeButton={false}
newestOnTop
theme={theme.isDark ? 'dark' : 'light'}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function useBidirectionalStreaming() {
} catch (error: any) {
notification(
{ title: 'Invoke request error', description: error.message },
{ type: 'error' }
{ type: 'error', position: 'bottom-right' }
);

deleteContext(tab.id);
Expand All @@ -112,7 +112,10 @@ export function useBidirectionalStreaming() {
});
}
} catch (error: any) {
notification({ title: `Send message error`, description: error.message }, { type: 'error' });
notification(
{ title: `Send message error`, description: error.message },
{ type: 'error', position: 'bottom-right' }
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function useClientStreaming() {
} catch (error: any) {
notification(
{ title: 'Invoke request error', description: error.message },
{ type: 'error' }
{ type: 'error', position: 'bottom-right' }
);

deleteContext(tab.id);
Expand All @@ -94,7 +94,10 @@ export function useClientStreaming() {
});
}
} catch (error: any) {
notification({ title: `Send message error`, description: error.message }, { type: 'error' });
notification(
{ title: `Send message error`, description: error.message },
{ type: 'error', position: 'bottom-right' }
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function useUnaryCall() {
} catch (error: any) {
notification(
{ title: 'Invoke request error', description: error.message },
{ type: 'error' }
{ type: 'error', position: 'bottom-right' }
);
} finally {
deleteContext(tab.id);
Expand Down
4 changes: 2 additions & 2 deletions src/app/storage/collections.storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export const useCollectionsStore = create(
title: `${collection.name}`,
description: 'Collection successfully updated',
},
{ type: 'success' }
{ type: 'success', position: 'top-right' }
);
}
} catch (error: any) {
Expand All @@ -110,7 +110,7 @@ export const useCollectionsStore = create(
title: `${collection.name} sync error`,
description: error?.message,
},
{ type: 'error' }
{ type: 'error', position: 'top-right' }
);
}
}
Expand Down

0 comments on commit ade02cf

Please sign in to comment.