2 Commity 209a10f1ac ... 119c46775d

Autor SHA1 Wiadomość Data
  raylu 119c46775d roi: remove Building interface 1 dzień temu
  Thomas Knott 546f62fa81 roi: save CX in localStorage 2 tygodni temu
1 zmienionych plików z 7 dodań i 6 usunięć
  1. 7 6
      ts/roi.ts

+ 7 - 6
ts/roi.ts

@@ -11,6 +11,12 @@ async function getROI(cx: string) {
 const lowVolume = document.querySelector('input#low-volume') as HTMLInputElement;
 
 const cxSelect = document.querySelector('select#cx') as HTMLSelectElement;
+{
+	const savedCx = localStorage.getItem('cx');
+	if (savedCx !== null)
+		cxSelect.value = savedCx;
+}
+
 const expertise = {
 	AGRICULTURE: 'agri',
 	CHEMISTRY: 'chem',
@@ -107,6 +113,7 @@ async function render() {
 	}
 	document.getElementById('last-updated')!.textContent =
 		`last updated: ${lastModified.toLocaleString(undefined, {dateStyle: 'full', timeStyle: 'long', hour12: false})}`;
+	localStorage.setItem('cx', cx);
 }
 
 function color(n: number, low: number, high: number): string {
@@ -149,9 +156,3 @@ interface MatPrice {
 	amount: number
 	vwap_7d: number
 }
-
-interface Building {
-	building_type: 'INFRASTRUCTURE' | 'PLANETARY' | 'PRODUCTION';
-	building_ticker: string;
-	expertise: keyof typeof expertise;
-}