1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

fix: This object has been frozen and should not be mutated

This commit is contained in:
Sylvain 2021-04-08 11:09:33 +02:00
parent 6da577d4ae
commit d091c44c11
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ const PayZenKeysFormComponent: React.FC<PayZenKeysFormProps> = ({ onValidKeys })
* When the component loads for the first time, initialize the keys with the values fetched from the API (if any)
*/
useEffect(() => {
updateSettings(payZenKeys.read());
updateSettings(new Map(payZenKeys.read()));
}, []);
/**

View File

@ -61,7 +61,7 @@ export const PayzenSettings: React.FC<PayzenSettingsProps> = ({ onEditKeys, onCu
* For the private settings, we initialize them with the placeholder value, if the setting is set.
*/
useEffect(() => {
const map = payZenKeys.read();
const map = new Map(payZenKeys.read());
for (const setting of payZenPrivateSettings) {
map.set(setting, isPresent[setting].read() ? PAYZEN_HIDDEN : '');
}