Automated counts for guestbook, friends, and groups tabs

This commit is contained in:
Mr. Stallion 2019-07-03 18:11:12 -05:00
parent dc81023547
commit 49e58b27c7
4 changed files with 158 additions and 15 deletions

64
package-lock.json generated
View File

@ -6,6 +6,8 @@
"dependencies": { "dependencies": {
"@f-list/fork-ts-checker-webpack-plugin": { "@f-list/fork-ts-checker-webpack-plugin": {
"version": "0.5.2", "version": "0.5.2",
"resolved": "https://registry.npmjs.org/@f-list/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-0.5.2.tgz",
"integrity": "sha512-0MTjYGG6e8KuIPcMwSy/3uMC2jYWAV2d5+Q8V3DkHT9hC982aRI9FFO72yWow4vKq25z6Tdov/dtcOGn8jxu7g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@vue/component-compiler-utils": "^2.3.1", "@vue/component-compiler-utils": "^2.3.1",
@ -19,6 +21,8 @@
}, },
"@f-list/vue-ts": { "@f-list/vue-ts": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@f-list/vue-ts/-/vue-ts-1.0.2.tgz",
"integrity": "sha512-NWp79Io3DRAh7nYQ23yckW6IoI/Sn9O6JlfCvi2B9BFAXqXl7ShY2jcp+tlasDhFZ8CFBYoZDftnodEeGySHqw==",
"dev": true, "dev": true,
"requires": { "requires": {
"typescript": "^3.2.2", "typescript": "^3.2.2",
@ -27,10 +31,14 @@
}, },
"@fortawesome/fontawesome-free": { "@fortawesome/fontawesome-free": {
"version": "5.6.1", "version": "5.6.1",
"resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.6.1.tgz",
"integrity": "sha512-0afQfB+HBeJHlXPzcF2Jjh78SbwPSkDjba/O7pZFzAW3WGKNzd4s4AqrZo7oIlMWGnfoyDo8+QeosK0+DTDrTg==",
"dev": true "dev": true
}, },
"@types/lodash": { "@types/lodash": {
"version": "4.14.119", "version": "4.14.119",
"resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.119.tgz",
"integrity": "sha512-Z3TNyBL8Vd/M9D9Ms2S3LmFq2sSMzahodD6rCS9V2N44HUMINb75jNkSuwAx7eo2ufqTdfOdtGQpNbieUjPQmw==",
"dev": true "dev": true
}, },
"@types/node": { "@types/node": {
@ -47,6 +55,8 @@
}, },
"@types/sortablejs": { "@types/sortablejs": {
"version": "1.7.0", "version": "1.7.0",
"resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.7.0.tgz",
"integrity": "sha512-VVsUcV+c3SEUqoLcP43zEkZArKulFK+NH2su9ZqWyzI9ZRZCVjQMdJh2H8LASnHzWxatpCzIfIyCT8B64ZDbMw==",
"dev": true "dev": true
}, },
"@vue/component-compiler-utils": { "@vue/component-compiler-utils": {
@ -471,6 +481,8 @@
}, },
"appdmg": { "appdmg": {
"version": "0.5.2", "version": "0.5.2",
"resolved": "https://registry.npmjs.org/appdmg/-/appdmg-0.5.2.tgz",
"integrity": "sha512-i9ajRl1SscJgH63TmDpm/KLSCom7jCs2a2riT0onDFLNNO/h/lYmJHa2k3Ywn8jxhiv7jyhYR+Hofk+EiKXtPg==",
"optional": true, "optional": true,
"requires": { "requires": {
"async": "^1.4.2", "async": "^1.4.2",
@ -698,6 +710,8 @@
}, },
"axios": { "axios": {
"version": "0.18.0", "version": "0.18.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.18.0.tgz",
"integrity": "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
"dev": true, "dev": true,
"requires": { "requires": {
"follow-redirects": "^1.3.0", "follow-redirects": "^1.3.0",
@ -949,6 +963,8 @@
}, },
"bootstrap": { "bootstrap": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.1.3.tgz",
"integrity": "sha512-rDFIzgXcof0jDyjNosjv4Sno77X4KuPeFxG2XZZv1/Kc8DRVGVADdoQyyOVDwPqL36DDmtCQbrpMCqvpPLJQ0w==",
"dev": true "dev": true
}, },
"bplist-creator": { "bplist-creator": {
@ -1768,6 +1784,8 @@
}, },
"css-loader": { "css-loader": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/css-loader/-/css-loader-2.0.1.tgz",
"integrity": "sha512-XIVwoIOzSFRVsafOKa060GJ/A70c0IP/C1oVPHEX4eHIFF39z0Jl7j8Kua1SUTiqWDupUnbY3/yQx9r7EUB35w==",
"dev": true, "dev": true,
"requires": { "requires": {
"icss-utils": "^4.0.0", "icss-utils": "^4.0.0",
@ -1987,6 +2005,8 @@
}, },
"date-fns": { "date-fns": {
"version": "1.30.1", "version": "1.30.1",
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz",
"integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==",
"dev": true "dev": true
}, },
"date-now": { "date-now": {
@ -2264,6 +2284,8 @@
}, },
"electron": { "electron": {
"version": "3.0.13", "version": "3.0.13",
"resolved": "https://registry.npmjs.org/electron/-/electron-3.0.13.tgz",
"integrity": "sha512-tfx5jFgXhCmpe6oPjcesaRj7geHqQxrJdbpseanRzL9BbyYUtsj0HoxwPAUvCx4+52P6XryBwWTvne/1eBVf9Q==",
"dev": true, "dev": true,
"requires": { "requires": {
"@types/node": "^8.0.24", "@types/node": "^8.0.24",
@ -2307,6 +2329,8 @@
}, },
"electron-log": { "electron-log": {
"version": "2.2.17", "version": "2.2.17",
"resolved": "https://registry.npmjs.org/electron-log/-/electron-log-2.2.17.tgz",
"integrity": "sha512-v+Af5W5z99ehhaLOfE9eTSXUwjzh2wFlQjz51dvkZ6ZIrET6OB/zAZPvsuwT6tm3t5x+M1r+Ed3U3xtPZYAyuQ==",
"dev": true "dev": true
}, },
"electron-notarize": { "electron-notarize": {
@ -2372,6 +2396,8 @@
}, },
"electron-packager": { "electron-packager": {
"version": "13.0.1", "version": "13.0.1",
"resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-13.0.1.tgz",
"integrity": "sha512-fXfldaZ1wihpPaMTSGMxvCeETJwVArlnMmKafVXLJbbZwS+WTjY4iL7ju9WMQ0LNGuiiIwSMCQFxt5iA087mqg==",
"dev": true, "dev": true,
"requires": { "requires": {
"asar": "^0.14.0", "asar": "^0.14.0",
@ -2484,6 +2510,8 @@
}, },
"electron-rebuild": { "electron-rebuild": {
"version": "1.8.2", "version": "1.8.2",
"resolved": "https://registry.npmjs.org/electron-rebuild/-/electron-rebuild-1.8.2.tgz",
"integrity": "sha512-EeR4dgb6NN7ybxduUWMeeLhU/EuF+FzwFZJfMJXD0bx96K+ttAieCXOn9lTO5nA9Qn3hiS7pEpk8pZ9StpGgSg==",
"dev": true, "dev": true,
"requires": { "requires": {
"colors": "^1.2.0", "colors": "^1.2.0",
@ -2522,6 +2550,8 @@
}, },
"electron-squirrel-startup": { "electron-squirrel-startup": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/electron-squirrel-startup/-/electron-squirrel-startup-1.0.0.tgz",
"integrity": "sha1-GbTlWTP6Dvj1VnhLnGYPdyVGoLg=",
"optional": true, "optional": true,
"requires": { "requires": {
"debug": "^2.2.0" "debug": "^2.2.0"
@ -2535,6 +2565,8 @@
}, },
"electron-winstaller": { "electron-winstaller": {
"version": "2.7.0", "version": "2.7.0",
"resolved": "https://registry.npmjs.org/electron-winstaller/-/electron-winstaller-2.7.0.tgz",
"integrity": "sha512-WKRUTyGzTQbM2Q6dYm/iQqdYRQRTMiFakPxqOCJrH29YPVelGG9vNldal68fnq2yL+FFsoQi/3+qb6jDk143mw==",
"optional": true, "optional": true,
"requires": { "requires": {
"asar": "^0.11.0", "asar": "^0.11.0",
@ -3010,6 +3042,8 @@
}, },
"extract-loader": { "extract-loader": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/extract-loader/-/extract-loader-3.1.0.tgz",
"integrity": "sha512-baiz/xalbyQJOTHwcMJKXYsHbhEHGWQ2loK26vqZVoqO6eeinrnSrMx9681pNZgGRqz2L/PsyNxz+PVDiSmNPg==",
"dev": true, "dev": true,
"requires": { "requires": {
"babel-runtime": "^6.26.0", "babel-runtime": "^6.26.0",
@ -3068,6 +3102,8 @@
}, },
"file-loader": { "file-loader": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/file-loader/-/file-loader-2.0.0.tgz",
"integrity": "sha512-YCsBfd1ZGCyonOKLxPiKPdu+8ld9HAaMEvJewzz+b2eTF7uL5Zm/HdBF6FjCrpCMRq25Mi0U1gl4pwn2TlH7hQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"loader-utils": "^1.0.2", "loader-utils": "^1.0.2",
@ -4868,6 +4904,8 @@
}, },
"keytar": { "keytar": {
"version": "4.3.0", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/keytar/-/keytar-4.3.0.tgz",
"integrity": "sha512-pd++/v+fS0LQKmzWlW6R1lziTXFqhfGeS6sYLfuTIqEy2pDzAbjutbSW8f9tnJdEEMn/9XhAQlT34VAtl9h4MQ==",
"requires": { "requires": {
"nan": "2.8.0", "nan": "2.8.0",
"prebuild-install": "^5.0.0" "prebuild-install": "^5.0.0"
@ -5544,6 +5582,8 @@
}, },
"node-sass": { "node-sass": {
"version": "4.11.0", "version": "4.11.0",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.11.0.tgz",
"integrity": "sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA==",
"dev": true, "dev": true,
"requires": { "requires": {
"async-foreach": "^0.1.3", "async-foreach": "^0.1.3",
@ -5804,6 +5844,8 @@
}, },
"optimize-css-assets-webpack-plugin": { "optimize-css-assets-webpack-plugin": {
"version": "5.0.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-5.0.1.tgz",
"integrity": "sha512-Rqm6sSjWtx9FchdP0uzTQDc7GXDKnwVEGoSxjezPkzMewx7gEWE9IMUYKmigTRC4U3RaNSwYVnUDLuIdtTpm0A==",
"dev": true, "dev": true,
"requires": { "requires": {
"cssnano": "^4.1.0", "cssnano": "^4.1.0",
@ -6714,6 +6756,8 @@
}, },
"qs": { "qs": {
"version": "6.6.0", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.6.0.tgz",
"integrity": "sha512-KIJqT9jQJDQx5h5uAVPimw6yVg2SekOKu959OCtktD3FjzbpvaPr8i4zzg07DOMz+igA4W/aNM7OV8H37pFYfA==",
"dev": true "dev": true
}, },
"querystring": { "querystring": {
@ -6765,6 +6809,8 @@
}, },
"raven-js": { "raven-js": {
"version": "3.27.0", "version": "3.27.0",
"resolved": "https://registry.npmjs.org/raven-js/-/raven-js-3.27.0.tgz",
"integrity": "sha512-vChdOL+yzecfnGA+B5EhEZkJ3kY3KlMzxEhShKh6Vdtooyl0yZfYNFQfYzgMf2v4pyQa+OTZ5esTxxgOOZDHqw==",
"dev": true "dev": true
}, },
"raw-body": { "raw-body": {
@ -7099,6 +7145,8 @@
}, },
"sass-loader": { "sass-loader": {
"version": "7.1.0", "version": "7.1.0",
"resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-7.1.0.tgz",
"integrity": "sha512-+G+BKGglmZM2GUSfT9TLuEp6tzehHPjAMoRRItOojWIqIGPloVCMhNIQuG639eJ+y033PaGTSjLaTHts8Kw79w==",
"dev": true, "dev": true,
"requires": { "requires": {
"clone-deep": "^2.0.1", "clone-deep": "^2.0.1",
@ -7550,6 +7598,8 @@
}, },
"sortablejs": { "sortablejs": {
"version": "1.8.0-rc1", "version": "1.8.0-rc1",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.8.0-rc1.tgz",
"integrity": "sha512-umyNbQVDwRgc0SZvUB+FRUIUqACnu5vCCmK0zv/xWA3eDSOh+IZsg3GHdWvEOcUBwnykqyk760+YPgVa8HfxFg==",
"dev": true "dev": true
}, },
"source-list-map": { "source-list-map": {
@ -7644,6 +7694,8 @@
}, },
"spellchecker": { "spellchecker": {
"version": "3.5.0", "version": "3.5.0",
"resolved": "https://registry.npmjs.org/spellchecker/-/spellchecker-3.5.0.tgz",
"integrity": "sha512-Xa7XnRulYhh5N/XENeL2O8/875XhLBjos7Bemv0rfcgV6ojNYMSrXscUZUGJwniX2t67eY+lNUJeptD1bMauHQ==",
"requires": { "requires": {
"any-promise": "^1.3.0", "any-promise": "^1.3.0",
"nan": "^2.10.0" "nan": "^2.10.0"
@ -7833,6 +7885,8 @@
}, },
"style-loader": { "style-loader": {
"version": "0.23.1", "version": "0.23.1",
"resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.23.1.tgz",
"integrity": "sha512-XK+uv9kWwhZMZ1y7mysB+zoihsEj4wneFWAS5qoiLwzW0WzSqMrrsIy+a3zkQJq0ipFtBpX5W3MqyRIBF/WFGg==",
"dev": true, "dev": true,
"requires": { "requires": {
"loader-utils": "^1.1.0", "loader-utils": "^1.1.0",
@ -8157,6 +8211,8 @@
}, },
"ts-loader": { "ts-loader": {
"version": "5.3.1", "version": "5.3.1",
"resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-5.3.1.tgz",
"integrity": "sha512-fDDgpBH3SR8xlt2MasLdz3Yy611PQ/UY/KGyo7TgXhTRU/6sS8uGG0nJYnU1OdFBNKcoYbId1UTNaAOUn+i41g==",
"dev": true, "dev": true,
"requires": { "requires": {
"chalk": "^2.3.0", "chalk": "^2.3.0",
@ -8174,6 +8230,8 @@
}, },
"tslint": { "tslint": {
"version": "5.12.0", "version": "5.12.0",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-5.12.0.tgz",
"integrity": "sha512-CKEcH1MHUBhoV43SA/Jmy1l24HJJgI0eyLbBNSRyFlsQvb9v6Zdq+Nz2vEOH00nC5SUx4SneJ59PZUS/ARcokQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"babel-code-frame": "^6.22.0", "babel-code-frame": "^6.22.0",
@ -8516,6 +8574,8 @@
}, },
"vue-loader": { "vue-loader": {
"version": "15.4.2", "version": "15.4.2",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.4.2.tgz",
"integrity": "sha512-nVV27GNIA9MeoD8yQ3dkUzwlAaAsWeYSWZHsu/K04KCD339lW0Jv2sJWsjj3721SP7sl2lYdPmjcHgkWQSp5bg==",
"dev": true, "dev": true,
"requires": { "requires": {
"@vue/component-compiler-utils": "^2.0.0", "@vue/component-compiler-utils": "^2.0.0",
@ -8537,6 +8597,8 @@
}, },
"vue-template-compiler": { "vue-template-compiler": {
"version": "2.5.21", "version": "2.5.21",
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.5.21.tgz",
"integrity": "sha512-Vmk5Cv7UcmI99B9nXJEkaK262IQNnHp5rJYo+EwYpe2epTAXqcVyExhV6pk8jTkxQK2vRc8v8KmZBAwdmUZvvw==",
"dev": true, "dev": true,
"requires": { "requires": {
"de-indent": "^1.0.2", "de-indent": "^1.0.2",
@ -8562,6 +8624,8 @@
}, },
"webpack": { "webpack": {
"version": "4.27.1", "version": "4.27.1",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.27.1.tgz",
"integrity": "sha512-WArHiLvHrlfyRM8i7f+2SFbr/XbQ0bXqTkPF8JpHOzub5482Y3wx7rEO8stuLGOKOgZJcqcisLhD7LrM/+fVMw==",
"dev": true, "dev": true,
"requires": { "requires": {
"@webassemblyjs/ast": "1.7.11", "@webassemblyjs/ast": "1.7.11",

View File

@ -6,9 +6,9 @@ This repository contains a modified version of the mainline F-Chat 3.0 client.
## Key Differences ## Key Differences
* Ad auto-posting * Ad auto-posting
* Manage channel's ad settings in "Tab Settings" * Manage channel's ad settings via "Tab Settings"
* Automatically repost ads every 11-18 minutes (randomized) * Automatically re-post ads every 11-18 minutes (randomized) for up to 180 minutes
* Auto-posting can rotate through multiple ads * Rotate multiple ads on a single channel
* Link previews * Link previews
* Hover cursor over any `[url]` to see a preview of it * Hover cursor over any `[url]` to see a preview of it
* Profile * Profile
@ -17,7 +17,7 @@ This repository contains a modified version of the mainline F-Chat 3.0 client.
* Custom kinks are highlighted * Custom kinks are highlighted
* Gender, anthro/human preference, age, and sexual preference are highlighted if compatible or incompatible * Gender, anthro/human preference, age, and sexual preference are highlighted if compatible or incompatible
* Guestbook, friend, and group counts are visible on tabs * Guestbook, friend, and group counts are visible on tabs
* Character pictures are expanded inline * Character images are expanded inline
* Cleaner presentation for the side bar details (age, etc.), sorted in most relevant order * Cleaner presentation for the side bar details (age, etc.), sorted in most relevant order
* Less informative side bar details (views, contact) are separated and shown in a less prominent way * Less informative side bar details (views, contact) are separated and shown in a less prominent way
* Cleaner guestbook view * Cleaner guestbook view

View File

@ -27,10 +27,10 @@
<tabs class="card-header-tabs" v-model="tab"> <tabs class="card-header-tabs" v-model="tab">
<span>Overview</span> <span>Overview</span>
<span>Info</span> <span>Info</span>
<span v-if="!oldApi">Groups</span> <span v-if="!oldApi">Groups <span class="tab-count" v-if="groupCount !== null">({{ groupCount }})</span></span>
<span>Images ({{ character.character.image_count }})</span> <span>Images <span class="tab-count">({{ character.character.image_count }})</span></span>
<span v-if="character.settings.guestbook">Guestbook</span> <span v-if="character.settings.guestbook">Guestbook <span class="tab-count" v-if="guestbookPostCount !== null">({{ guestbookPostCount }})</span></span>
<span v-if="character.is_self || character.settings.show_friends">Friends</span> <span v-if="character.is_self || character.settings.show_friends">Friends <span class="tab-count" v-if="friendCount !== null">({{ friendCount }})</span></span>
</tabs> </tabs>
</div> </div>
<div class="card-body"> <div class="card-body">
@ -67,6 +67,8 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import * as _ from 'lodash';
import {Component, Hook, Prop, Watch} from '@f-list/vue-ts'; import {Component, Hook, Prop, Watch} from '@f-list/vue-ts';
import Vue from 'vue'; import Vue from 'vue';
import {standardParser} from '../../bbcode/standard'; import {standardParser} from '../../bbcode/standard';
@ -122,6 +124,11 @@
error = ''; error = '';
tab = '0'; tab = '0';
guestbookPostCount: string | null = null;
friendCount: string | null = null;
groupCount: string | null = null;
selfCharacter: Character | undefined; selfCharacter: Character | undefined;
characterMatch: MatchReport | undefined; characterMatch: MatchReport | undefined;
@ -157,6 +164,11 @@
try { try {
const due: Promise<any>[] = []; const due: Promise<any>[] = [];
if(this.name === undefined || this.name.length === 0)
return;
await methods.fieldsGet();
if ((this.selfCharacter === undefined) && (Utils.Settings.defaultCharacter >= 0)) { if ((this.selfCharacter === undefined) && (Utils.Settings.defaultCharacter >= 0)) {
due.push(this.loadSelfCharacter()); due.push(this.loadSelfCharacter());
} }
@ -176,6 +188,60 @@
this.loading = false; this.loading = false;
} }
async countGuestbookPosts() {
try {
if ((!this.character) || (!_.get(this.character, 'settings.guestbook'))) {
this.guestbookPostCount = null;
return;
}
const guestbookState = await methods.guestbookPageGet(this.character.character.id, 1, false);
console.log('GUESTBOOK', guestbookState.posts);
this.guestbookPostCount = `${guestbookState.posts.length}${guestbookState.nextPage ? '+' : ''}`;
} catch (err) {
console.error(err);
this.guestbookPostCount = null;
}
}
async countGroups() {
try {
if ((!this.character) || (this.oldApi)) {
this.groupCount = null;
return;
}
const groups = await methods.groupsGet(this.character.character.id);
this.groupCount = `${groups.length}`;
} catch (err) {
console.error(err);
this.groupCount = null;
}
}
async countFriends() {
try {
if (!this.character) {
this.friendCount = null;
return;
}
const friends = await methods.friendsGet(this.character.character.id);
this.friendCount = `${friends.length}`;
} catch (err) {
console.error(err);
this.friendCount = null;
}
}
memo(memo: {id: number, memo: string}): void { memo(memo: {id: number, memo: string}): void {
Vue.set(this.character!, 'memo', memo); Vue.set(this.character!, 'memo', memo);
} }
@ -200,15 +266,19 @@
private async _getCharacter(): Promise<void> { private async _getCharacter(): Promise<void> {
this.character = undefined; this.character = undefined;
this.friendCount = null;
this.groupCount = null;
this.guestbookPostCount = null;
if(this.name === undefined || this.name.length === 0)
return;
await methods.fieldsGet();
this.character = await methods.characterData(this.name, this.characterid); this.character = await methods.characterData(this.name, this.characterid);
standardParser.allowInlines = true; standardParser.allowInlines = true;
standardParser.inlines = this.character.character.inlines; standardParser.inlines = this.character.character.inlines;
// no awaits on these on purpose
this.countGuestbookPosts();
this.countGroups();
this.countFriends();
this.updateMatches(); this.updateMatches();
} }
@ -602,4 +672,9 @@
// background-color: #710300; // background-color: #710300;
} }
.tab-count {
color: rgba(255, 255, 255, 0.5);
}
</style> </style>

View File

@ -35,6 +35,10 @@
readonly characterMatch!: MatchReport; readonly characterMatch!: MatchReport;
get groupedInfotags(): DisplayInfotagGroup[] { get groupedInfotags(): DisplayInfotagGroup[] {
if ((!this.character) || (!this.character.character)) {
return [];
}
const groups = Store.kinks.infotag_groups; const groups = Store.kinks.infotag_groups;
const infotags = Store.kinks.infotags; const infotags = Store.kinks.infotags;
const characterTags = this.character.character.infotags; const characterTags = this.character.character.infotags;
@ -42,10 +46,10 @@
const groupedTags = Utils.groupObjectBy(infotags, 'infotag_group'); const groupedTags = Utils.groupObjectBy(infotags, 'infotag_group');
for(const groupId in groups) { for(const groupId in groups) {
const group = groups[groupId]!; const group = groups[groupId]!;
const groupedInfotags = groupedTags[groupId]; const gits = groupedTags[groupId];
if(groupedInfotags === undefined) continue; if(gits === undefined) continue;
const collectedTags: DisplayInfotag[] = []; const collectedTags: DisplayInfotag[] = [];
for(const infotag of groupedInfotags) { for(const infotag of gits) {
const characterInfotag = characterTags[infotag.id]; const characterInfotag = characterTags[infotag.id];
if(typeof characterInfotag === 'undefined') if(typeof characterInfotag === 'undefined')
continue; continue;