File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/keyring-controller/src Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2176,12 +2176,16 @@ export class KeyringController extends BaseController<
21762176 }
21772177
21782178 /**
2179- * Updates the cached vault encryption key.
2179+ * Updates the cached vault encryption key. This key will be persisted in
2180+ * the state at the next update if envelope encryption is enabled.
21802181 *
21812182 * @param encryptionKey - Optional new vault encryption key.
21822183 */
21832184 #updateCachedEncryptionKey( encryptionKey ?: string ) {
21842185 if ( ! encryptionKey && this . state . encryptedEncryptionKey ) {
2186+ // If no encryption key is provided and we are in envelope encryption
2187+ // mode, use the cached encryption key. This case occurs when we call
2188+ // change password without providing a new encryption key.
21852189 this . #encryptionKey = this . state . encryptionKey ;
21862190 } else {
21872191 this . #encryptionKey = encryptionKey ;
You can’t perform that action at this time.
0 commit comments