Skip to content

Commit

Permalink
Fix some more linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianBouron committed Jul 6, 2024
1 parent 5afb2ed commit d90fae3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
26 changes: 2 additions & 24 deletions packages/extension/src/utils/storageLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,7 @@
*/

export const saveData = (key: string, value: string) => {
try {
localStorage.setItem(key, value);
} catch (e) {
/*
* If localStorage is disabled or blocked by the browser,
* a SecurityError exception will be thrown when trying to access localStorage.
* If the key or value argument passed to localStorage.setItem() is not a string,
* a TypeError exception will be thrown.
* If the user has exceeded the storage quota for localStorage,
* a QuotaExceededError exception will be thrown.
*/
throw e;
}
localStorage.setItem(key, value);

Check failure

Code scanning / CodeQL

Clear text storage of sensitive information High

This stores sensitive data returned by
an access to newTrustedApp
as clear text.
This stores sensitive data returned by
an access to trustedApp
as clear text.
This stores sensitive data returned by
an access to trustedApps
as clear text.
This stores sensitive data returned by
an access to stringifiedNewTrustedApps
as clear text.
This stores sensitive data returned by
an access to trustedApps
as clear text.
This stores sensitive data returned by
an access to mockTrustedApp
as clear text.
This stores sensitive data returned by
an access to mockTrustedApp
as clear text.
This stores sensitive data returned by
an access to trustedApps
as clear text.
This stores sensitive data returned by
an access to stringifiedTrustedApps
as clear text.
This stores sensitive data returned by
an access to updatedTrustedApp
as clear text.
This stores sensitive data returned by
an access to trustedApps
as clear text.
This stores sensitive data returned by
an access to mockTrustedApp
as clear text.
This stores sensitive data returned by
an access to mockTrustedApp2
as clear text.
This stores sensitive data returned by
an access to mockTrustedApp
as clear text.
This stores sensitive data returned by
an access to mockTrustedApp
as clear text.
This stores sensitive data returned by
an access to mockTrustedApp
as clear text.
This stores sensitive data returned by
an access to mockTrustedApp
as clear text.
This stores sensitive data returned by an access to mockTrustedApp as clear text.
This stores sensitive data returned by an access to mockTrustedApp as clear text.
};

export const loadData = (key: string) => {
Expand All @@ -35,15 +23,5 @@ export const loadData = (key: string) => {
};

export const removeData = (key: string) => {
try {
localStorage.removeItem(key);
} catch (e) {
/*
* If localStorage is disabled or blocked by the browser,
* a SecurityError exception will be thrown when trying to access localStorage.
* If the key argument passed to localStorage.removeItem() is not a string,
* a TypeError exception will be thrown.
*/
throw e;
}
localStorage.removeItem(key);
};
4 changes: 3 additions & 1 deletion packages/extension/src/utils/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export const checkFee = (fee: string | null) => {
if (Number(fee) && dropsToXrp(fee)) {
return fee;
}
} catch (e) {}
} catch (e) {
/* empty */
}
}
return null;
};
Expand Down

0 comments on commit d90fae3

Please sign in to comment.