makeLookup: Allow for key of zero
This commit is contained in:
@@ -203,6 +203,7 @@ const dataInterface: ClientInterface = {
|
||||
getAllStickerPacks,
|
||||
getAllStickers,
|
||||
getRecentStickers,
|
||||
clearAllErrorStickerPackAttempts,
|
||||
|
||||
updateEmojiUsage,
|
||||
getRecentEmojis,
|
||||
@@ -1333,6 +1334,9 @@ async function getRecentStickers() {
|
||||
|
||||
return recentStickers;
|
||||
}
|
||||
async function clearAllErrorStickerPackAttempts() {
|
||||
await channels.clearAllErrorStickerPackAttempts();
|
||||
}
|
||||
|
||||
// Emojis
|
||||
async function updateEmojiUsage(shortName: string) {
|
||||
|
@@ -169,6 +169,7 @@ export type DataInterface = {
|
||||
getRecentStickers: (options?: {
|
||||
limit?: number;
|
||||
}) => Promise<Array<StickerType>>;
|
||||
clearAllErrorStickerPackAttempts: () => Promise<void>;
|
||||
|
||||
updateEmojiUsage: (shortName: string, timeUsed?: number) => Promise<void>;
|
||||
getRecentEmojis: (limit?: number) => Promise<Array<EmojiType>>;
|
||||
|
@@ -180,6 +180,7 @@ const dataInterface: ServerInterface = {
|
||||
getAllStickerPacks,
|
||||
getAllStickers,
|
||||
getRecentStickers,
|
||||
clearAllErrorStickerPackAttempts,
|
||||
|
||||
updateEmojiUsage,
|
||||
getRecentEmojis,
|
||||
@@ -3465,6 +3466,13 @@ async function updateStickerPackStatus(
|
||||
}
|
||||
);
|
||||
}
|
||||
async function clearAllErrorStickerPackAttempts(): Promise<void> {
|
||||
const db = getInstance();
|
||||
|
||||
await db.run(
|
||||
"UPDATE sticker_packs SET downloadAttempts = 0 WHERE status = 'error';"
|
||||
);
|
||||
}
|
||||
async function createOrUpdateSticker(sticker: StickerType) {
|
||||
const db = getInstance();
|
||||
const {
|
||||
|
Reference in New Issue
Block a user