2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2019-2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-10-26 19:15:33 +00:00
|
|
|
import type { StickerPackType } from '../../state/ducks/stickers';
|
2019-06-27 20:35:21 +00:00
|
|
|
|
|
|
|
// This function exists to force stickers to be counted consistently wherever
|
|
|
|
// they are counted (TypeScript ensures that all data is named and provided)
|
|
|
|
export function countStickers(o: {
|
|
|
|
knownPacks: ReadonlyArray<StickerPackType>;
|
|
|
|
blessedPacks: ReadonlyArray<StickerPackType>;
|
|
|
|
installedPacks: ReadonlyArray<StickerPackType>;
|
|
|
|
receivedPacks: ReadonlyArray<StickerPackType>;
|
2020-09-14 22:14:03 +00:00
|
|
|
}): number {
|
2019-06-27 20:35:21 +00:00
|
|
|
return (
|
|
|
|
o.knownPacks.length +
|
|
|
|
o.blessedPacks.length +
|
|
|
|
o.installedPacks.length +
|
|
|
|
o.receivedPacks.length
|
|
|
|
);
|
|
|
|
}
|