MCPcopy Create free account
hub / github.com/continuedev/continue / getLocalStorage

Function getLocalStorage

gui/src/util/localStorage.ts:26–44  ·  view source on GitHub ↗
(
  key: T,
)

Source from the content-addressed store, hash-verified

24}
25
26export function getLocalStorage<T extends keyof LocalStorageTypes>(
27 key: T,
28): LocalStorageTypes[T] | undefined {
29 const value = localStorage.getItem(key);
30
31 if (value === null) {
32 return undefined;
33 }
34
35 try {
36 return JSON.parse(value);
37 } catch (error) {
38 console.error(
39 `Error parsing ${key} from local storage. Value was ${value}\n\n`,
40 error,
41 );
42 return undefined;
43 }
44}
45
46export function setLocalStorage<T extends keyof LocalStorageTypes>(
47 key: T,

Callers 13

DeprecationBannerFunction · 0.90
isNewUserOnboardingFunction · 0.90
OnboardingCardFunction · 0.90
useOnboardingCardFunction · 0.90
submitOnboardingFunction · 0.90
ChatFunction · 0.90
ExploreDialogWatcherFunction · 0.90
syncWithLocalStorageFunction · 0.90
uiSlice.tsFile · 0.90
useInputHistoryFunction · 0.90
getFontSizeFunction · 0.90
isJetBrainsFunction · 0.90

Calls 2

errorMethod · 0.80
getItemMethod · 0.65

Tested by

no test coverage detected