Skip to content

Commit 6d8869f

Browse files
authored
fix(compass-web): provide a destroy method in devtools connect polyfill COMPASS-7698 (#5536)
fix(compass-web): provide a destroy method in devtools connect polyfill
1 parent 87a791a commit 6d8869f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/compass-web/polyfills/@mongodb-js/devtools-connect/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ export async function connectMongoClient(
2323
return Promise.resolve('Not Available');
2424
},
2525
oidcPlugin: { logger },
26+
destroy() {
27+
return Promise.resolve();
28+
},
2629
},
2730
};
2831
}

packages/compass-web/sandbox/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ const App = () => {
150150
setConnectionStringValidationResult,
151151
] = useState<null | string>(null);
152152

153+
(window as any).disconnectCompassWeb = () => {
154+
setOpenCompassWeb(false);
155+
};
156+
153157
const canSubmit =
154158
connectionStringValidationResult === null && connectionString !== '';
155159

0 commit comments

Comments
 (0)