@jbrowse/plugin-linear-genome-view 1.6.3 → 1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "JBrowse 2 linear genome view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "c6d6783d3dc82ea96390ab177ceb8ed38b439333"
64
+ "gitHead": "7f157fbb2302d8825f99d01bcc0fd0616116c5d2"
65
65
  }
@@ -104,6 +104,12 @@ export const INTER_REGION_PADDING_WIDTH = 2
104
104
  export const WIDGET_HEIGHT = 32
105
105
  export const SPACING = 7
106
106
 
107
+ function localStorageGetItem(item: string) {
108
+ return typeof localStorage !== 'undefined'
109
+ ? localStorage.getItem(item)
110
+ : undefined
111
+ }
112
+
107
113
  export function stateModelFactory(pluginManager: PluginManager) {
108
114
  return types
109
115
  .compose(
@@ -128,14 +134,14 @@ export function stateModelFactory(pluginManager: PluginManager) {
128
134
  ),
129
135
  trackLabels: types.optional(
130
136
  types.string,
131
- () => localStorage.getItem('lgv-trackLabels') || 'overlapping',
137
+ () => localStorageGetItem('lgv-trackLabels') || 'overlapping',
132
138
  ),
133
139
  showCenterLine: types.optional(types.boolean, () => {
134
- const setting = localStorage.getItem('lgv-showCenterLine')
140
+ const setting = localStorageGetItem('lgv-showCenterLine')
135
141
  return setting !== undefined ? !!setting : false
136
142
  }),
137
143
  showCytobandsSetting: types.optional(types.boolean, () => {
138
- const setting = localStorage.getItem('lgv-showCytobands')
144
+ const setting = localStorageGetItem('lgv-showCytobands')
139
145
  return setting !== undefined ? !!setting : true
140
146
  }),
141
147
  }),