From ef6bbaf009a5b7d7f348147a3f75d76cd6058c4f Mon Sep 17 00:00:00 2001 From: a Date: Wed, 6 Jul 2022 02:48:11 -0500 Subject: [PATCH] cant log out lol --- package-lock.json | 25 ++ package.json | 2 + src/components/CharacterCard.vue | 16 +- src/components/CharacterRoulette.vue | 8 +- src/lib/columns/column.ts | 75 +++++ src/lib/columns/column_impl.ts | 452 +++++++++++++++++++++++++++ src/lib/columns/index.ts | 3 + src/lib/lifeto.ts | 149 --------- src/lib/lifeto/api.ts | 40 +++ src/lib/lifeto/index.ts | 3 + src/lib/lifeto/lifeto.ts | 78 +++++ src/lib/lifeto/stateful.ts | 39 +++ src/lib/{columns.ts => old.ts} | 30 +- src/lib/storage.ts | 10 +- src/lib/table.ts | 22 +- src/lib/trickster.ts | 63 ++-- src/pages/login.vue | 14 + src/session_storage.ts | 10 +- src/state/state.ts | 30 +- 19 files changed, 820 insertions(+), 249 deletions(-) create mode 100644 src/lib/columns/column.ts create mode 100644 src/lib/columns/column_impl.ts create mode 100644 src/lib/columns/index.ts delete mode 100644 src/lib/lifeto.ts create mode 100644 src/lib/lifeto/api.ts create mode 100644 src/lib/lifeto/index.ts create mode 100644 src/lib/lifeto/lifeto.ts create mode 100644 src/lib/lifeto/stateful.ts rename src/lib/{columns.ts => old.ts} (98%) diff --git a/package-lock.json b/package-lock.json index 30503f3..8dd019d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@handsontable/vue3": "^12.0.1", "@types/numbro": "^1.9.3", "@types/qs": "^6.9.7", + "@types/uuid": "^8.3.4", "@vueuse/core": "^8.7.5", "axios": "^0.27.2", "handsontable": "^12.0.1", @@ -18,6 +19,7 @@ "pinia": "^2.0.14", "qs": "^6.10.5", "typescript-cookie": "^1.0.3", + "uuid": "^8.3.2", "vue": "^3.2.25", "vue3-cookies": "^1.0.6" }, @@ -70,6 +72,11 @@ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + }, "node_modules/@types/web-bluetooth": { "version": "0.0.14", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.14.tgz", @@ -1195,6 +1202,14 @@ "node": ">= 0.4.0" } }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/vite": { "version": "2.9.12", "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.12.tgz", @@ -1301,6 +1316,11 @@ "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==" }, + "@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==" + }, "@types/web-bluetooth": { "version": "0.0.14", "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.14.tgz", @@ -2000,6 +2020,11 @@ "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==", "optional": true }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, "vite": { "version": "2.9.12", "resolved": "https://registry.npmjs.org/vite/-/vite-2.9.12.tgz", diff --git a/package.json b/package.json index 0100f4d..4baa91f 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@handsontable/vue3": "^12.0.1", "@types/numbro": "^1.9.3", "@types/qs": "^6.9.7", + "@types/uuid": "^8.3.4", "@vueuse/core": "^8.7.5", "axios": "^0.27.2", "handsontable": "^12.0.1", @@ -18,6 +19,7 @@ "pinia": "^2.0.14", "qs": "^6.10.5", "typescript-cookie": "^1.0.3", + "uuid": "^8.3.2", "vue": "^3.2.25", "vue3-cookies": "^1.0.6" }, diff --git a/src/components/CharacterCard.vue b/src/components/CharacterCard.vue index 35d9565..7267c99 100644 --- a/src/components/CharacterCard.vue +++ b/src/components/CharacterCard.vue @@ -13,19 +13,22 @@ const props = defineProps(['character']) const name = ref(props.character.split("/").pop()) const job = ref("") const galders = ref(0) -const {invs, activeTable} = useStoreRef() +const {invs, activeTable, chars} = useStoreRef() watch(invs.value,()=>{ const currentInv = invs.value.get(props.character) if(currentInv){ - if(currentInv.wallet){ - name.value = currentInv.name! - job.value = currentInv.wallet?.job_img! - galders.value = currentInv.wallet?.galders! - } + name.value = currentInv.name! + galders.value = currentInv.galders! } },{deep:true}) +const currentChar = chars.value.get(props.character) +if(currentChar){ + name.value = currentChar.name! + job.value = JobNumberToString(currentChar.current_job) +} + const selectCharacter = () => { activeTable.value = props.character @@ -38,6 +41,7 @@ import log from 'loglevel'; import { defineComponent, computed, PropType, defineProps, defineEmits, ref, watch, onMounted} from 'vue'; import { getLTOState, LTOApi, LTOApiv0 } from '../lib/lifeto'; import { LoginHelper, Session } from '../lib/session'; +import { JobNumberToString } from '../lib/trickster'; import { storage } from '../session_storage'; import { useStore, useStoreRef } from '../state/state'; diff --git a/src/components/CharacterRoulette.vue b/src/components/CharacterRoulette.vue index f821477..ee421d0 100644 --- a/src/components/CharacterRoulette.vue +++ b/src/components/CharacterRoulette.vue @@ -7,19 +7,21 @@