mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Refactor console error to be provider level, tracking error via boolean rather than full logs as state.
This commit is contained in:
1 parent
3fba26ddb7
commit
7574085213
10 files changed
+469
-93
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { useContext } from 'react';
|
||||
import { ConsoleErrorContext } from '@/contexts/ConsoleErrorContext';
|
||||
|
||||
/**
|
||||
* Hook to access console error state from the ConsoleErrorProvider.
|
||||
* Provides boolean error state and console error information for Quilly.
|
||||
*/
|
||||
export function useConsoleError() {
|
||||
const context = useContext(ConsoleErrorContext);
|
||||
|
||||
if (context === undefined) {
|
||||
throw new Error('useConsoleError must be used within a ConsoleErrorProvider');
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
Reference in new issue
Block a user