Re-enable link-and-sync in Alpha
This commit is contained in:
parent
c6902ec26a
commit
962a2def18
3 changed files with 9 additions and 5 deletions
|
@ -196,7 +196,7 @@ function startInstaller(): ThunkAction<
|
|||
const { server } = window.textsecure;
|
||||
strictAssert(server, 'Expected a server');
|
||||
|
||||
const provisioner = new Provisioner(server);
|
||||
const provisioner = new Provisioner(server, window.getVersion());
|
||||
|
||||
const abortController = new AbortController();
|
||||
const { signal } = abortController;
|
||||
|
|
|
@ -78,7 +78,10 @@ export class Provisioner {
|
|||
private state: StateType = { step: Step.Idle };
|
||||
private wsr: IWebSocketResource | undefined;
|
||||
|
||||
constructor(private readonly server: WebAPIType) {}
|
||||
constructor(
|
||||
private readonly server: WebAPIType,
|
||||
private readonly appVersion: string
|
||||
) {}
|
||||
|
||||
public close(error = new Error('Provisioner closed')): void {
|
||||
try {
|
||||
|
@ -242,7 +245,7 @@ export class Provisioner {
|
|||
.toAppUrl({
|
||||
uuid,
|
||||
pubKey: Bytes.toBase64(pubKey),
|
||||
capabilities: isLinkAndSyncEnabled() ? ['backup'] : [],
|
||||
capabilities: isLinkAndSyncEnabled(this.appVersion) ? ['backup'] : [],
|
||||
})
|
||||
.toString();
|
||||
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
|
||||
import { isTestOrMockEnvironment } from '../environment';
|
||||
import { isStagingServer } from './isStagingServer';
|
||||
import { isAlpha } from './version';
|
||||
import { everDone as wasRegistrationEverDone } from './registration';
|
||||
|
||||
export function isLinkAndSyncEnabled(): boolean {
|
||||
export function isLinkAndSyncEnabled(version: string): boolean {
|
||||
// Cannot overwrite existing message history
|
||||
if (wasRegistrationEverDone()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return isStagingServer() || isTestOrMockEnvironment();
|
||||
return isStagingServer() || isTestOrMockEnvironment() || isAlpha(version);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue