Ensure that Olm is only loaded once

React 18's strict mode intentionally mounts all components twice, which was causing Olm to get double-loaded. Also, it doesn't need to be loaded if the app is running as a widget.
This commit is contained in:
Robin Townsend
2022-10-31 13:43:03 -04:00
parent e42a83bbc4
commit d4caa1585b
5 changed files with 67 additions and 52 deletions

View File

@@ -106,7 +106,8 @@
],
"moduleNameMapper": {
"\\.(css|less|svg)+$": "identity-obj-proxy",
"./IndexedDBWorker\\?worker": "<rootDir>/test/mocks/workerMock.ts"
"^\\./IndexedDBWorker\\?worker$": "<rootDir>/test/mocks/workerMock.ts",
"^\\./olm$": "<rootDir>/test/mocks/olmMock.ts"
}
}
}