mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-08 08:58:38 +01:00
Use single WebAPI instance across the app
This commit is contained in:
@@ -34,12 +34,13 @@ describe('Conversations', () => {
|
||||
version: 0,
|
||||
});
|
||||
|
||||
window.textsecure.storage.user.setNumberAndDeviceId(
|
||||
ourNumber,
|
||||
2,
|
||||
'my device'
|
||||
);
|
||||
window.textsecure.storage.user.setUuidAndDeviceId(ourUuid, 2);
|
||||
await window.textsecure.storage.user.setCredentials({
|
||||
number: ourNumber,
|
||||
uuid: ourUuid,
|
||||
deviceId: 2,
|
||||
deviceName: 'my device',
|
||||
password: 'password',
|
||||
});
|
||||
await window.ConversationController.loadPromise();
|
||||
|
||||
await window.Signal.Data.saveConversation(conversation.attributes);
|
||||
|
||||
@@ -7,6 +7,7 @@ import { setup as setupI18n } from '../../../js/modules/i18n';
|
||||
import enMessages from '../../../_locales/en/messages.json';
|
||||
import { SendStatus } from '../../messages/MessageSendState';
|
||||
import MessageSender from '../../textsecure/SendMessage';
|
||||
import { WebAPIType } from '../../textsecure/WebAPI';
|
||||
import { CallbackResultType } from '../../textsecure/Types.d';
|
||||
import type { StorageAccessType } from '../../types/Storage.d';
|
||||
import { SignalService as Proto } from '../../protobuf';
|
||||
@@ -81,7 +82,7 @@ describe('Message', () => {
|
||||
oldMessageSender = window.textsecure.messaging;
|
||||
|
||||
window.textsecure.messaging =
|
||||
oldMessageSender ?? new MessageSender('username', 'password');
|
||||
oldMessageSender ?? new MessageSender({} as WebAPIType);
|
||||
this.sandbox
|
||||
.stub(window.textsecure.messaging, 'sendSyncMessage')
|
||||
.resolves({});
|
||||
|
||||
Reference in New Issue
Block a user