Skip to content

Commit

Permalink
Tidy up SMASH
Browse files Browse the repository at this point in the history
  • Loading branch information
bleunguts committed Jan 27, 2024
1 parent 45e5ecf commit 7e87202
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Web/src/TradingStrategyStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class TradingStrategyStore
);
}

error = () => {
loadErrorPlaceholder = () => {
this.symbol = `ERROR LOADING SYMBOL..`;
this.data = FakeStrategyPlaceholder;
};
Expand All @@ -52,12 +52,12 @@ export class TradingStrategyStore
if(cache != undefined){
this.data = cache as ChartData[];
} else {
this.error();
this.loadErrorPlaceholder();
}
break;
}
case 500: {
this.error();
this.loadErrorPlaceholder();
break;
}
default: {
Expand All @@ -69,16 +69,15 @@ export class TradingStrategyStore
.catch((e) => {
console.log(`Error occurred whilst loading new symbol... ${e}`);
console.log(e);
this.error();
this.loadErrorPlaceholder();
});

console.log(`Symbol: ${symbol} loaded, data length: ${this.data.length}`);
})
}
catch(e) {
console.log(`Error occurred whilst loading new symbol... ${e}`);
this.symbol = 'ERROR LOADING SYMBOL..';
this.data = FakeStrategyPlaceholder;
this.loadErrorPlaceholder();
}
finally {
this.isLoading = false;
Expand Down

0 comments on commit 7e87202

Please sign in to comment.