feat: events (#717)

This commit is contained in:
Daniel Lautzenheiser
2023-04-19 23:49:53 -04:00
committed by GitHub
parent 455bcdc0f2
commit 79877fcd1f
30 changed files with 72 additions and 56 deletions

View File

@ -18,6 +18,7 @@ import { loginUser as loginUserAction } from '@staticcms/core/actions/auth';
import { discardDraft } from '@staticcms/core/actions/entries';
import { currentBackend } from '@staticcms/core/backend';
import { changeTheme } from '../actions/globalUI';
import { invokeEvent } from '../lib/registry';
import { getDefaultPath } from '../lib/util/collection.util';
import { selectTheme } from '../reducers/selectors/globalUI';
import { useAppDispatch, useAppSelector } from '../store/hooks';
@ -229,6 +230,12 @@ const App = ({
);
}, [authenticationPage, collections, defaultPath, isFetching, user]);
useEffect(() => {
setTimeout(() => {
invokeEvent({ name: 'mounted' });
});
}, []);
if (!config.config) {
return configError(t('app.app.configNotFound'));
}

View File

@ -62,7 +62,7 @@ function buildIssueUrl(title: string, config?: Config) {
return `${ISSUE_URL}${params.toString()}`;
} catch (e) {
console.info(e);
console.error(e);
return `${ISSUE_URL}template=bug_report.md`;
}
}
@ -72,7 +72,7 @@ interface RecoveredEntryProps {
}
const RecoveredEntry = ({ entry, t }: TranslatedProps<RecoveredEntryProps>) => {
console.info(entry);
console.info('[StaticCMS] Recovered entry', entry);
return (
<>
<hr />
@ -134,7 +134,7 @@ class ErrorBoundary extends Component<TranslatedProps<ErrorBoundaryProps>, Error
if (this.props.showBackup) {
const backup = await localForage.getItem<string>('backup');
if (backup) {
console.info(backup);
console.info('[StaticCMS] Recovered backup', backup);
this.setState({ backup });
}
}