Import/export sticker packs
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
This commit is contained in:
parent
d426109734
commit
a0fb131294
5 changed files with 62 additions and 15 deletions
|
@ -214,7 +214,11 @@ function downloadStickerPack(
|
|||
function installStickerPack(
|
||||
packId: string,
|
||||
packKey: string,
|
||||
options: { fromSync?: boolean; fromStorageService?: boolean } = {}
|
||||
options: {
|
||||
fromSync?: boolean;
|
||||
fromStorageService?: boolean;
|
||||
fromBackup?: boolean;
|
||||
} = {}
|
||||
): InstallStickerPackAction {
|
||||
return {
|
||||
type: 'stickers/INSTALL_STICKER_PACK',
|
||||
|
@ -224,19 +228,27 @@ function installStickerPack(
|
|||
async function doInstallStickerPack(
|
||||
packId: string,
|
||||
packKey: string,
|
||||
options: { fromSync?: boolean; fromStorageService?: boolean } = {}
|
||||
options: {
|
||||
fromSync?: boolean;
|
||||
fromStorageService?: boolean;
|
||||
fromBackup?: boolean;
|
||||
} = {}
|
||||
): Promise<InstallStickerPackPayloadType> {
|
||||
const { fromSync = false, fromStorageService = false } = options;
|
||||
const {
|
||||
fromSync = false,
|
||||
fromStorageService = false,
|
||||
fromBackup = false,
|
||||
} = options;
|
||||
|
||||
const timestamp = Date.now();
|
||||
await dataInterface.installStickerPack(packId, timestamp);
|
||||
|
||||
if (!fromSync && !fromStorageService) {
|
||||
if (!fromSync && !fromStorageService && !fromBackup) {
|
||||
// Kick this off, but don't wait for it
|
||||
void sendStickerPackSync(packId, packKey, true);
|
||||
}
|
||||
|
||||
if (!fromStorageService) {
|
||||
if (!fromStorageService && !fromBackup) {
|
||||
storageServiceUploadJob();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue