Skip to content

Commit

Permalink
updating git attributes for lfs on compiled react ui pages
Browse files Browse the repository at this point in the history
  • Loading branch information
its-a-feature committed Nov 15, 2024
1 parent 43a081c commit 228c0ab
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main.*.js.* filter=lfs diff=lfs merge=lfs -text
2 changes: 2 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ jobs:
# Pull in the repository code
- name: Checkout the repository
uses: actions/checkout@v4 # ref: https://github.com/marketplace/actions/checkout
with:
lfs: true
- name: Log in to the container registry
uses: docker/login-action@v3 # ref: https://github.com/marketplace/actions/docker-login
with:
Expand Down
6 changes: 6 additions & 0 deletions MythicReactUI/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.57] - 2024-11-15

### Changed

- Updated the preferences loading to take place on login

## [0.2.56] - 2024-11-14

### Changed
Expand Down
24 changes: 19 additions & 5 deletions MythicReactUI/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Reporting } from './pages/Reporting/Reporting';
import { MitreAttack } from './pages/MITRE_ATTACK/MitreAttack';
import {Tags} from './pages/Tags/Tags';
import { Tooltip } from 'react-tooltip';
import {useQuery, gql } from '@apollo/client';
import {useQuery, useLazyQuery, gql } from '@apollo/client';
//background-color: #282c34;
import { Route, Routes } from 'react-router-dom';
import { useInterval } from './utilities/Time';
Expand All @@ -39,7 +39,7 @@ import {Eventing} from "./pages/Eventing/Eventing";
import {InviteForm} from "./pages/Login/InviteForm";
import {snackActions} from "./utilities/Snackbar";

const userSettingsQuery = gql`
export const userSettingsQuery = gql`
query getUserSettings {
getOperatorPreferences {
status
Expand Down Expand Up @@ -129,8 +129,7 @@ export function App(props) {
);
const mountedRef = React.useRef(true);
const [openRefreshDialog, setOpenRefreshDialog] = React.useState(false);

useQuery(userSettingsQuery, {
const [getUserPreferences] = useLazyQuery(userSettingsQuery, {
onCompleted: (data) => {
//console.log("got preferences", data.getOperatorPreferences.preferences)
if(data.getOperatorPreferences.status === "success"){
Expand Down Expand Up @@ -161,9 +160,24 @@ export function App(props) {
}
}
}, 600000, mountedRef, mountedRef);
React.useEffect( () => {
if(me.loggedIn){
setLoadingPreferences(true);
getUserPreferences();
} else {
setLoadingPreferences(false);
}
}, [me.loggedIn])
if(loadingPreference){
// make sure we've loaded preferences before loading actual app content
return null
return (
<StyledEngineProvider injectFirst>
<ThemeProvider theme={theme}>
<GlobalStyles theme={theme} />
<CssBaseline />
</ThemeProvider>
</StyledEngineProvider>
)
}
return (
<StyledEngineProvider injectFirst>
Expand Down
2 changes: 1 addition & 1 deletion MythicReactUI/src/components/pages/Login/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Button, Paper} from '@mui/material';
import MythicTextField from '../../MythicComponents/MythicTextField';
import logo from '../../../assets/mythic-red.png';
import { Navigate } from 'react-router-dom';
import { meState, successfulLogin, FailedRefresh } from '../../../cache';
import {meState, successfulLogin, FailedRefresh, mePreferences} from '../../../cache';
import { useReactiveVar } from '@apollo/client';
import {restartWebsockets, isJWTValid} from '../../../index';
import { snackActions } from '../../utilities/Snackbar';
Expand Down
2 changes: 1 addition & 1 deletion MythicReactUI/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {snackActions} from './components/utilities/Snackbar';
import jwt_decode from 'jwt-decode';
import {meState} from './cache';

export const mythicUIVersion = "0.2.56";
export const mythicUIVersion = "0.2.57";

let fetchingNewToken = false;

Expand Down

0 comments on commit 228c0ab

Please sign in to comment.