Skip to content

Commit 16988a2

Browse files
committed
init graph health only on frontend
1 parent a8e97d3 commit 16988a2

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@quest-chains/sdk",
33
"description": "An SDK for building applications on top of Quest Chains",
4-
"version": "0.1.12",
4+
"version": "0.1.13",
55
"license": "GPL-3.0",
66
"main": "dist/index.js",
77
"typings": "dist/index.d.ts",

src/graphql/health.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ class SubgraphHealthStore {
4949
}
5050
}
5151

52-
const HealthStoreSingleton = (function () {
52+
const HealthStoreSingleton = (function() {
5353
let instance: SubgraphHealthStore;
5454

5555
function createInstance() {
5656
return new SubgraphHealthStore();
5757
}
5858

5959
return {
60-
getInstance: function () {
60+
getInstance: function() {
6161
if (!instance) {
6262
instance = createInstance();
6363
}
@@ -70,6 +70,8 @@ const getSubgraphStatus = () => HealthStoreSingleton.getInstance().status();
7070

7171
const initSubgraphHealthStore = getSubgraphStatus;
7272

73-
initSubgraphHealthStore();
73+
if (typeof window !== 'undefined') {
74+
initSubgraphHealthStore();
75+
}
7476

7577
export const getSubgraphLatestBlock = (chainId: string): number => getSubgraphStatus()[chainId];

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"typeRoots": ["node_modules/@types"],
66
"module": "commonjs",
77
"resolveJsonModule": true,
8-
"lib": ["esnext"],
8+
"lib": ["esnext", "dom"],
99
"importHelpers": true,
1010
"declaration": true,
1111
"sourceMap": true,

0 commit comments

Comments
 (0)