mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore: avoid undefined property on Global type (#21631)
This commit is contained in:
@@ -105,7 +105,9 @@ describe('comms', () => {
|
||||
let originalConsoleError: any = null;
|
||||
|
||||
beforeAll(() => {
|
||||
global.MessageChannel = FakeMessageChannel; // yolo
|
||||
Object.defineProperty(global, 'MessageChannel', {
|
||||
value: FakeMessageChannel,
|
||||
});
|
||||
originalConsoleDebug = console.debug;
|
||||
originalConsoleError = console.error;
|
||||
});
|
||||
|
||||
@@ -283,7 +283,7 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
|
||||
setBarTopOffset(headerRef.current?.getBoundingClientRect()?.height || 0);
|
||||
|
||||
let observer: ResizeObserver;
|
||||
if (typeof global.ResizeObserver !== 'undefined' && headerRef.current) {
|
||||
if (global.hasOwnProperty('ResizeObserver') && headerRef.current) {
|
||||
observer = new ResizeObserver(entries => {
|
||||
setBarTopOffset(
|
||||
current => entries?.[0]?.contentRect?.height || current,
|
||||
|
||||
Reference in New Issue
Block a user