mirror of
https://github.com/status-im/sourcecred.git
synced 2025-01-27 12:55:14 +00:00
Use CheckedLocalStore
in the cred explorer (#526)
Summary: Might as well have runtime type safety, in case we accidentally try to store any more `Map`s or `undefined`s. Test Plan: Tests pass, but are likely not sufficient. Manual testing indicates that the local storage still works, for both reads and writes, on a fresh profile or with existing data, for both the repository owner/name and the weight configuration. wchargin-branch: use-checked-local-store
This commit is contained in:
parent
c0da12af6e
commit
8655838b2c
@ -4,7 +4,9 @@ import React from "react";
|
||||
import {StyleSheet, css} from "aphrodite/no-important";
|
||||
|
||||
import type {LocalStore} from "../localStore";
|
||||
import CheckedLocalStore from "../checkedLocalStore";
|
||||
import BrowserLocalStore from "../browserLocalStore";
|
||||
|
||||
import {StaticPluginAdapter as GithubAdapter} from "../../plugins/github/pluginAdapter";
|
||||
import {StaticPluginAdapter as GitAdapter} from "../../plugins/git/pluginAdapter";
|
||||
import {Graph} from "../../core/graph";
|
||||
@ -22,10 +24,12 @@ const REPO_NAME_KEY = "repoName";
|
||||
const MAX_ENTRIES_PER_LIST = 100;
|
||||
|
||||
export default class AppPage extends React.Component<{||}> {
|
||||
static _LOCAL_STORE = new BrowserLocalStore({
|
||||
version: "1",
|
||||
keyPrefix: "cred-explorer",
|
||||
});
|
||||
static _LOCAL_STORE = new CheckedLocalStore(
|
||||
new BrowserLocalStore({
|
||||
version: "1",
|
||||
keyPrefix: "cred-explorer",
|
||||
})
|
||||
);
|
||||
|
||||
render() {
|
||||
return <App localStore={AppPage._LOCAL_STORE} />;
|
||||
|
Loading…
x
Reference in New Issue
Block a user