mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-04 09:01:01 +01:00
[PM-7687] Fix reloadPopup
Recursion (#8902)
* Fix Message Sending Recursion * Remove Change That Didn't Help * Prefer `isExternalMessage` Guard * Rollback Compare Change --------- Co-authored-by: Cesar Gonzalez <cesar.a.gonzalezcs@gmail.com>
This commit is contained in:
parent
3f4adff2c5
commit
a6755f5f20
@ -10,7 +10,7 @@ import { SystemService } from "@bitwarden/common/platform/abstractions/system.se
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { CipherType } from "@bitwarden/common/vault/enums";
|
||||
|
||||
import { MessageListener } from "../../../../libs/common/src/platform/messaging";
|
||||
import { MessageListener, isExternalMessage } from "../../../../libs/common/src/platform/messaging";
|
||||
import {
|
||||
closeUnlockPopout,
|
||||
openSsoAuthResultPopout,
|
||||
@ -266,7 +266,9 @@ export default class RuntimeBackground {
|
||||
break;
|
||||
}
|
||||
case "reloadPopup":
|
||||
this.messagingService.send("reloadPopup");
|
||||
if (isExternalMessage(msg)) {
|
||||
this.messagingService.send("reloadPopup");
|
||||
}
|
||||
break;
|
||||
case "emailVerificationRequired":
|
||||
this.messagingService.send("showDialog", {
|
||||
|
@ -92,9 +92,16 @@ export class LocalBackedSessionStorageService
|
||||
// This is for observation purposes only. At some point, we don't want to write to local session storage if the value is the same.
|
||||
if (this.platformUtilsService.isDev()) {
|
||||
const existingValue = this.cache[key] as T;
|
||||
if (this.compareValues<T>(existingValue, obj)) {
|
||||
this.logService.warning(`Possible unnecessary write to local session storage. Key: ${key}`);
|
||||
this.logService.warning(obj as any);
|
||||
try {
|
||||
if (this.compareValues<T>(existingValue, obj)) {
|
||||
this.logService.warning(
|
||||
`Possible unnecessary write to local session storage. Key: ${key}`,
|
||||
);
|
||||
this.logService.warning(obj as any);
|
||||
}
|
||||
} catch (err) {
|
||||
this.logService.warning(`Error while comparing values for key: ${key}`);
|
||||
this.logService.warning(err);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user