2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Use special webview storage for tonsite.

This commit is contained in:
John Preston
2024-07-29 12:26:22 +02:00
parent 2dcf40817e
commit 4f37343e8b
7 changed files with 55 additions and 10 deletions

View File

@@ -3198,4 +3198,18 @@ bool Account::decrypt(
return true;
}
Webview::StorageId TonSiteStorageId() {
auto result = Webview::StorageId{
.path = BaseGlobalPath() + u"webview-tonsite"_q,
.token = Core::App().settings().tonsiteStorageToken(),
};
if (result.token.isEmpty()) {
result.token = QByteArray::fromStdString(
Webview::GenerateStorageToken());
Core::App().settings().setTonsiteStorageToken(result.token);
Core::App().saveSettingsDelayed();
}
return result;
}
} // namespace Storage