참조관계 수정.
This commit is contained in:
parent
9079361aa5
commit
ffb79c7de0
|
@ -200,6 +200,7 @@
|
|||
<ucap-sticker-selector
|
||||
*ngIf="isShowStickerSelector"
|
||||
#stickerSelector
|
||||
[stickerHistory]='getStickerHistory()'
|
||||
(selectedSticker)="onSelectedSticker($event)"
|
||||
class="sticker-selector-zone"
|
||||
></ucap-sticker-selector>
|
||||
|
|
|
@ -1125,4 +1125,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
]);
|
||||
}
|
||||
}
|
||||
getStickerHistory(): string[] {
|
||||
return this.localStorageService.get<string[]>(KEY_STICKER_HISTORY);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
|
||||
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
|
||||
import {
|
||||
StickerInfo,
|
||||
StickerFilesInfo,
|
||||
StickerUtil,
|
||||
StickerMap
|
||||
} from '@ucap-webmessenger/core';
|
||||
import { LocalStorageService } from '@ucap-webmessenger/web-storage';
|
||||
import { KEY_STICKER_HISTORY } from '@app/types';
|
||||
|
||||
@Component({
|
||||
selector: 'ucap-sticker-selector',
|
||||
|
@ -14,6 +12,9 @@ import { KEY_STICKER_HISTORY } from '@app/types';
|
|||
styleUrls: ['./sticker-selector.component.scss']
|
||||
})
|
||||
export class StickerSelectorComponent implements OnInit {
|
||||
@Input()
|
||||
stickerHistory: string[] = [];
|
||||
|
||||
@Output()
|
||||
selectedSticker = new EventEmitter<StickerFilesInfo>();
|
||||
|
||||
|
@ -24,7 +25,7 @@ export class StickerSelectorComponent implements OnInit {
|
|||
|
||||
currentTabIndex: number;
|
||||
|
||||
constructor(private localStorageService: LocalStorageService) {}
|
||||
constructor() {}
|
||||
|
||||
ngOnInit() {
|
||||
this.stickerInfoList = StickerUtil.getStickerInfoList();
|
||||
|
@ -54,11 +55,9 @@ export class StickerSelectorComponent implements OnInit {
|
|||
getStickerInfos(stickerInfo: StickerInfo) {
|
||||
if (stickerInfo.index === '00') {
|
||||
const rtnArray: StickerFilesInfo[] = [];
|
||||
const history = this.localStorageService.get<string[]>(
|
||||
KEY_STICKER_HISTORY
|
||||
);
|
||||
if (!!history && history.length > 0) {
|
||||
history.forEach(sticker => {
|
||||
|
||||
if (!!this.stickerHistory && this.stickerHistory.length > 0) {
|
||||
this.stickerHistory.forEach(sticker => {
|
||||
const arr: string[] = sticker.split('_');
|
||||
if (arr.length === 2) {
|
||||
const sInfo: StickerInfo[] = StickerMap.filter(
|
||||
|
|
Loading…
Reference in New Issue
Block a user