# 이슈처리 255

This commit is contained in:
leejinho 2020-02-19 14:53:12 +09:00
parent cb121b3612
commit f1be49220f
3 changed files with 34 additions and 20 deletions

View File

@ -203,6 +203,8 @@ function createWindow() {
window.onDidLoad(() => { window.onDidLoad(() => {
if (!appStorage.startupHideWindow) { if (!appStorage.startupHideWindow) {
window.show(); window.show();
} else {
window.hide();
} }
const fns = onDidLoadFns; const fns = onDidLoadFns;

View File

@ -8,11 +8,19 @@ export class JsonAnalization {
const endJson = jsonStr.lastIndexOf('}'); const endJson = jsonStr.lastIndexOf('}');
if (startJson >= 0 && startJson < endJson) { if (startJson >= 0 && startJson < endJson) {
jsonStr = jsonStr jsonStr = jsonStr.substring(startJson, endJson + 1);
.substring(startJson, endJson + 1) jsonStr = jsonStr.replace(/\r\n/gi, '\\n');
.replace(/\n"/gi, '"') jsonStr = jsonStr.replace(/\n/gi, '\\n');
.replace(/\n}/gi, '}') jsonStr = jsonStr.replace(/\\n"/gi, '"');
.replace(/\n/gi, '\\n'); 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); return JSON.parse(jsonStr);
} else { } else {

View File

@ -641,21 +641,25 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
this.chatMessages.initEventMore(); this.chatMessages.initEventMore();
if (!this.selectedSticker) { if (!this.selectedSticker) {
if (!message || message.trim().length === 0) { try {
const result = await this.dialogService.open< if (!message || message.trim().length === 0) {
AlertDialogComponent, const result = await this.dialogService.open<
AlertDialogData, AlertDialogComponent,
AlertDialogResult AlertDialogData,
>(AlertDialogComponent, { AlertDialogResult
width: '360px', >(AlertDialogComponent, {
data: { width: '360px',
title: this.translateService.instant('chat.errors.label'), data: {
message: this.translateService.instant( title: this.translateService.instant('chat.errors.label'),
'chat.errors.inputChatMessage' message: this.translateService.instant(
) 'chat.errors.inputChatMessage'
} )
}); }
return; });
return;
}
} catch (e) {
console.log(e);
} }
} }