From 805e09753922bd90dedd922102bfd121b187fccb Mon Sep 17 00:00:00 2001 From: "Mr. Stallion" Date: Sat, 30 Jan 2021 18:46:27 -0600 Subject: [PATCH] Cleanup on aisle 'colon' --- chat/ConversationView.vue | 20 +++++++++++++++++--- chat/UserView.vue | 4 ++-- chat/message_view.ts | 6 ++++-- learn/store/indexed.ts | 25 ++++++++++++++++++------- 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/chat/ConversationView.vue b/chat/ConversationView.vue index 2660acb..175cdc5 100644 --- a/chat/ConversationView.vue +++ b/chat/ConversationView.vue @@ -841,6 +841,14 @@ } .message { + .message-pre { + font-size: 75%; + padding-right: 2px; + padding-left: 1px; + opacity: 0.90; + display: inline-block; + } + &.message-event { font-size: 85%; background-color: rgba(255, 255, 255, 0.1); @@ -876,7 +884,9 @@ .bbcode, .user-view, - .message-time { + .message-time, + .message-pre, + .message-post { opacity: 0.6; } }; @@ -891,7 +901,9 @@ .bbcode, .user-view, - .message-time { + .message-time, + .message-pre, + .message-post { opacity: 0.55; } } @@ -905,7 +917,9 @@ .bbcode, .user-view, - .message-time { + .message-time, + .message-pre, + .message-post { opacity: 0.3; } } diff --git a/chat/UserView.vue b/chat/UserView.vue index 1cead31..fc72412 100644 --- a/chat/UserView.vue +++ b/chat/UserView.vue @@ -117,8 +117,8 @@ export default class UserView extends Vue { @Prop() readonly showStatus?: boolean = true; - @Prop() - readonly bookmark?: boolean = false; + @Prop({default: true}) + readonly bookmark?: boolean = true; @Prop() readonly match?: boolean = false; diff --git a/chat/message_view.ts b/chat/message_view.ts index 7502aaa..d5bd753 100644 --- a/chat/message_view.ts +++ b/chat/message_view.ts @@ -34,9 +34,11 @@ const userPostfix: {[key: number]: string | undefined} = { ((this.classes !== undefined) ? ` ${this.classes}` : '') + ` ${this.scoreClasses}`; if(message.type !== Conversation.Message.Type.Event) { - children.push((message.type === Conversation.Message.Type.Action) ? '*' : '', + children.push( + (message.type === Conversation.Message.Type.Action) ? createElement('i', { class: 'message-pre fas fa-star' }) : '', createElement(UserView, {props: {character: message.sender, channel: this.channel}}), - userPostfix[message.type] !== undefined ? userPostfix[message.type]! : ' '); + userPostfix[message.type] !== undefined ? createElement('span', { class: 'message-post' }, userPostfix[message.type]) : ' ' + ); if(message.isHighlight) classes += ' message-highlight'; } const isAd = message.type === Conversation.Message.Type.Ad && !this.logs; diff --git a/learn/store/indexed.ts b/learn/store/indexed.ts index 835e9e4..8a607e6 100644 --- a/learn/store/indexed.ts +++ b/learn/store/indexed.ts @@ -6,8 +6,6 @@ import { CharacterAnalysis } from '../matcher'; import { PermanentIndexedStore, ProfileRecord } from './types'; import { CharacterImage, SimpleCharacter } from '../../interfaces'; -import Bluebird from 'bluebird'; - async function promisifyRequest(req: IDBRequest): Promise { return new Promise((resolve, reject) => { @@ -224,12 +222,25 @@ export class IndexedStore implements PermanentIndexedStore { log.info('character.cache.expire', {daysToExpire, totalRecords, removableRecords: result.length}); - await Bluebird.mapSeries( - result, - async(pk: IDBValidKey) => { + return new Promise( + (resolve, reject) => { + const gen = (index: number): void => { + if(index >= result.length) { + resolve(); + return; + } + + const pk = result[index]; log.silly('character.cache.expire.name', { name: pk }); - await promisifyRequest(store.delete(pk)); - } + + const req = store.delete(pk); + + req.onsuccess = () => gen(index + 1); + req.onerror = reject; + }; + + gen(0); + } ); } }