# 이슈처리 255
This commit is contained in:
parent
cb121b3612
commit
f1be49220f
|
@ -203,6 +203,8 @@ function createWindow() {
|
|||
window.onDidLoad(() => {
|
||||
if (!appStorage.startupHideWindow) {
|
||||
window.show();
|
||||
} else {
|
||||
window.hide();
|
||||
}
|
||||
|
||||
const fns = onDidLoadFns;
|
||||
|
|
|
@ -8,11 +8,19 @@ export class JsonAnalization {
|
|||
const endJson = jsonStr.lastIndexOf('}');
|
||||
|
||||
if (startJson >= 0 && startJson < endJson) {
|
||||
jsonStr = jsonStr
|
||||
.substring(startJson, endJson + 1)
|
||||
.replace(/\n"/gi, '"')
|
||||
.replace(/\n}/gi, '}')
|
||||
.replace(/\n/gi, '\\n');
|
||||
jsonStr = jsonStr.substring(startJson, endJson + 1);
|
||||
jsonStr = jsonStr.replace(/\r\n/gi, '\\n');
|
||||
jsonStr = jsonStr.replace(/\n/gi, '\\n');
|
||||
jsonStr = jsonStr.replace(/\\n"/gi, '"');
|
||||
if (jsonStr.endsWith('\\n}')) {
|
||||
jsonStr = jsonStr.substr(0, jsonStr.length - 3) + '}';
|
||||
}
|
||||
// jsonStr = jsonStr.replace(/\\n}/gi, '}');
|
||||
|
||||
// jsonStr = jsonStr.replace(/\n"/gi, '"');
|
||||
// jsonStr = jsonStr.replace(/\n}/gi, '}');
|
||||
// jsonStr = jsonStr.replace(/\n/gi, '\\n');
|
||||
// jsonStr = jsonStr.replace(/\r\n/gi, '\\n');
|
||||
|
||||
return JSON.parse(jsonStr);
|
||||
} else {
|
||||
|
|
|
@ -641,21 +641,25 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
this.chatMessages.initEventMore();
|
||||
|
||||
if (!this.selectedSticker) {
|
||||
if (!message || message.trim().length === 0) {
|
||||
const result = await this.dialogService.open<
|
||||
AlertDialogComponent,
|
||||
AlertDialogData,
|
||||
AlertDialogResult
|
||||
>(AlertDialogComponent, {
|
||||
width: '360px',
|
||||
data: {
|
||||
title: this.translateService.instant('chat.errors.label'),
|
||||
message: this.translateService.instant(
|
||||
'chat.errors.inputChatMessage'
|
||||
)
|
||||
}
|
||||
});
|
||||
return;
|
||||
try {
|
||||
if (!message || message.trim().length === 0) {
|
||||
const result = await this.dialogService.open<
|
||||
AlertDialogComponent,
|
||||
AlertDialogData,
|
||||
AlertDialogResult
|
||||
>(AlertDialogComponent, {
|
||||
width: '360px',
|
||||
data: {
|
||||
title: this.translateService.instant('chat.errors.label'),
|
||||
message: this.translateService.instant(
|
||||
'chat.errors.inputChatMessage'
|
||||
)
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user