Skip to content

Commit

Permalink
Mfe bug fixes (harness#850)
Browse files Browse the repository at this point in the history
* Fixed deleted comment black background issue in mfe light mode

* Fixed current user not available in AppContext for MFE

* Fixed: When adding a PR comment 0 is displayed till the API call completes
  • Loading branch information
vivek-harness authored Jan 28, 2025
1 parent d1b6401 commit 88753ba
Showing 3 changed files with 208 additions and 216 deletions.
15 changes: 11 additions & 4 deletions apps/gitness/src/framework/context/AppContext.tsx
Original file line number Diff line number Diff line change
@@ -27,15 +27,22 @@ export const AppProvider: React.FC<{ children: ReactNode }> = ({ children }) =>
const [currentUser, setCurrentUser] = useLocalStorage<TypesUser>('currentUser', {})

useEffect(() => {
Promise.all([
Promise.allSettled([
membershipSpaces({
queryParams: { page: 1, limit: 100, sort: 'identifier', order: 'asc' }
}),
getUser({})
])
.then(([membershipResponse, userResponse]) => {
setSpaces(membershipResponse.body.filter(item => item?.space).map(item => item.space as TypesSpace))
setCurrentUser(userResponse.body)
.then(results => {
const [membershipResult, userResult] = results

if (membershipResult.status === 'fulfilled') {
setSpaces(membershipResult.value.body.filter(item => item?.space).map(item => item.space as TypesSpace))
}

if (userResult.status === 'fulfilled') {
setCurrentUser(userResult.value.body)
}
})
.catch(() => {
// Optionally handle error or show toast
2 changes: 1 addition & 1 deletion packages/ui/src/shared-style-variables.css
Original file line number Diff line number Diff line change
@@ -287,7 +287,7 @@
--canary-popover: 0 0% 100%;
--canary-popover-foreground: 240 10% 3.9%;
--canary-primary: 240 5.9% 10%;
--canary-primary-background: 240 5.9% 10%;
--canary-primary-background: 0 0% 100%;
--canary-primary-foreground: 0 0% 98%;
--canary-primary-muted: var(--canary-grey-70);
--canary-primary-accent: 216 100% 60%;
Loading

0 comments on commit 88753ba

Please sign in to comment.