mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
Refresh collection automatically when container is created using Quickstart pop up (#1394)
* Quickstart Refresh collection automatically when container is created * Fix unit tests * Fix unit tests and address comments * Minor fixes in message handler * Minor changes to fix tsconfig.strict.json * Resolve npm compile:strict errors by fixing the code implementation * Remove cache refresh code in configureHosted function * Fix spacing * Run npm format
This commit is contained in:
@@ -21,6 +21,23 @@ function isValidOrigin(allowedOrigins: ReadonlyArray<string>, event: MessageEven
|
||||
return false;
|
||||
}
|
||||
|
||||
export function shouldProcessMessage(event: MessageEvent): boolean {
|
||||
if (typeof event.data !== "object") {
|
||||
return false;
|
||||
}
|
||||
if (event.data["signature"] !== "pcIframe") {
|
||||
return false;
|
||||
}
|
||||
if (!("data" in event.data)) {
|
||||
return false;
|
||||
}
|
||||
if (typeof event.data["data"] !== "object") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
export function isReadyMessage(event: MessageEvent): boolean {
|
||||
if (!event?.data?.kind && !event?.data?.data) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user