Fixing socket store loc
Этот коммит содержится в:
@@ -20,31 +20,31 @@ import {intlShape, injectIntl, defineMessages} from 'mm-intl';
|
|||||||
const holders = defineMessages({
|
const holders = defineMessages({
|
||||||
socketError: {
|
socketError: {
|
||||||
id: 'channel_loader.socketError',
|
id: 'channel_loader.socketError',
|
||||||
defaultMessage: 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.'
|
defaultMessage: SocketStore.getDefaultTranslations().socketError
|
||||||
},
|
},
|
||||||
someone: {
|
someone: {
|
||||||
id: 'channel_loader.someone',
|
id: 'channel_loader.someone',
|
||||||
defaultMessage: 'Someone'
|
defaultMessage: SocketStore.getDefaultTranslations().someone
|
||||||
},
|
},
|
||||||
posted: {
|
posted: {
|
||||||
id: 'channel_loader.posted',
|
id: 'channel_loader.posted',
|
||||||
defaultMessage: 'Posted'
|
defaultMessage: SocketStore.getDefaultTranslations().posted
|
||||||
},
|
},
|
||||||
uploadedImage: {
|
uploadedImage: {
|
||||||
id: 'channel_loader.uploadedImage',
|
id: 'channel_loader.uploadedImage',
|
||||||
defaultMessage: ' uploaded an image'
|
defaultMessage: SocketStore.getDefaultTranslations().uploadedImage
|
||||||
},
|
},
|
||||||
uploadedFile: {
|
uploadedFile: {
|
||||||
id: 'channel_loader.uploadedFile',
|
id: 'channel_loader.uploadedFile',
|
||||||
defaultMessage: ' uploaded a file'
|
defaultMessage: SocketStore.getDefaultTranslations().uploadedFile
|
||||||
},
|
},
|
||||||
something: {
|
something: {
|
||||||
id: 'channel_loader.something',
|
id: 'channel_loader.something',
|
||||||
defaultMessage: ' did something new'
|
defaultMessage: SocketStore.getDefaultTranslations().something
|
||||||
},
|
},
|
||||||
wrote: {
|
wrote: {
|
||||||
id: 'channel_loader.wrote',
|
id: 'channel_loader.wrote',
|
||||||
defaultMessage: ' wrote: '
|
defaultMessage: SocketStore.getDefaultTranslations().wrote
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ class SocketStoreClass extends EventEmitter {
|
|||||||
|
|
||||||
this.failCount = 0;
|
this.failCount = 0;
|
||||||
|
|
||||||
|
this.translations = this.getDefaultTranslations();
|
||||||
|
|
||||||
this.initialize();
|
this.initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,6 +176,18 @@ class SocketStoreClass extends EventEmitter {
|
|||||||
this.translations = messages;
|
this.translations = messages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getDefaultTranslations() {
|
||||||
|
return ({
|
||||||
|
socketError: 'Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.',
|
||||||
|
someone: 'Someone',
|
||||||
|
posted: 'Posted',
|
||||||
|
uploadedImage: ' uploaded an image',
|
||||||
|
uploadedFile: ' uploaded a file',
|
||||||
|
something: ' did something new',
|
||||||
|
wrote: ' wrote: '
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
if (conn && conn.readyState === WebSocket.OPEN) {
|
if (conn && conn.readyState === WebSocket.OPEN) {
|
||||||
conn.close();
|
conn.close();
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user