Skip to content

Commit

Permalink
chore: fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Sep 23, 2024
1 parent be39719 commit 1760ffd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bundles/ipfs-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ const actions = {
if (kuboGateway === null || typeof kuboGateway === 'string' || typeof kuboGateway === 'boolean' || typeof kuboGateway === 'number') {
// empty or invalid, set defaults
await writeSetting('kuboGateway', { trustlessBlockBrokerConfig: { init: { allowLocal: true, allowInsecure: true } } })
} else if (kuboGateway.trustlessBlockBrokerConfig == null) {
} else if (/** @type {Record<string, any>} */(kuboGateway).trustlessBlockBrokerConfig == null) {
// missing trustlessBlockBrokerConfig, set defaults
await writeSetting('kuboGateway', { ...kuboGateway, trustlessBlockBrokerConfig: { init: { allowLocal: true, allowInsecure: true } } })
}
Expand Down
3 changes: 1 addition & 2 deletions src/bundles/local-storage.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/**
* Reads setting from the `localStorage` with a given `id` as JSON. If JSON
* parse is failed setting is interpreted as a string value.
* @template {string|number|boolean|Record<string,any>} T
* @param {string} id
* @returns {T|null}
* @returns {string|object|null}
*/
export const readSetting = (id) => {
/** @type {string|null} */
Expand Down

0 comments on commit 1760ffd

Please sign in to comment.