feat: added markdown to closed messages (#2255)

This commit is contained in:
Wyatt Johnson
2019-04-12 00:06:01 +02:00
committed by Kiwi
parent 08e8e61e88
commit 3b31e3b02d
10 changed files with 55 additions and 28 deletions
@@ -1,5 +1,5 @@
import { Child, Parent } from "pym.js";
import uuid from "uuid/v4";
import uuid from "uuid/v1";
import { PromisifiedStorage } from "./PromisifiedStorage";
type Pym = Child | Parent;
@@ -14,7 +14,8 @@ class PrefixedStorage implements Storage {
get length() {
let count = 0;
for (let i = 0; i < this.storage.length; i++) {
if (this.storage.key(i)!.startsWith(this.prefix)) {
const key = this.storage.key(i);
if (key && key.startsWith(this.prefix)) {
count++;
}
}
@@ -24,8 +25,8 @@ class PrefixedStorage implements Storage {
public clear() {
const toBeDeleted = [];
for (let i = 0; i < this.storage.length; i++) {
const key = this.storage.key(i)!;
if (key.startsWith(this.prefix)) {
const key = this.storage.key(i);
if (key && key.startsWith(this.prefix)) {
toBeDeleted.push(key);
}
}
@@ -35,8 +36,8 @@ class PrefixedStorage implements Storage {
public key(n: number) {
let count = 0;
for (let i = 0; i < this.storage.length; i++) {
const key = this.storage.key(i)!;
if (key.startsWith(this.prefix)) {
const key = this.storage.key(i);
if (key && key.startsWith(this.prefix)) {
if (count === n) {
return key;
}