Persist hasSetMyStoriesPrivacy in storage service

This commit is contained in:
Fedor Indutny 2022-09-07 11:31:13 -07:00 committed by Fedor Indutnyy
parent 03b750d072
commit ae01ad4276
2 changed files with 8 additions and 0 deletions

View file

@ -152,6 +152,7 @@ message AccountRecord {
optional string subscriberCurrencyCode = 22;
optional bool displayBadgesOnProfile = 23;
optional bool keepMutedChatsArchived = 25;
optional bool hasSetMyStoriesPrivacy = 26;
}
message StoryDistributionListRecord {

View file

@ -343,6 +343,11 @@ export function toAccountRecord(
accountRecord.keepMutedChatsArchived = keepMutedChatsArchived;
}
const hasSetMyStoriesPrivacy = window.storage.get('hasSetMyStoriesPrivacy');
if (hasSetMyStoriesPrivacy !== undefined) {
accountRecord.hasSetMyStoriesPrivacy = hasSetMyStoriesPrivacy;
}
applyUnknownFields(accountRecord, conversation);
return accountRecord;
@ -1024,6 +1029,7 @@ export async function mergeAccountRecord(
subscriberCurrencyCode,
displayBadgesOnProfile,
keepMutedChatsArchived,
hasSetMyStoriesPrivacy,
} = accountRecord;
const updatedConversations = new Array<ConversationModel>();
@ -1216,6 +1222,7 @@ export async function mergeAccountRecord(
}
window.storage.put('displayBadgesOnProfile', Boolean(displayBadgesOnProfile));
window.storage.put('keepMutedChatsArchived', Boolean(keepMutedChatsArchived));
window.storage.put('hasSetMyStoriesPrivacy', Boolean(hasSetMyStoriesPrivacy));
const ourID = window.ConversationController.getOurConversationId();