mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
feat: added markdown to closed messages (#2255)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user