fix: file name on update
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component, Input, OnInit, QueryList, ViewChildren } from "@angular/core";
|
||||
import { AfterViewInit, Component, Input, QueryList, ViewChildren } from "@angular/core";
|
||||
import { TranslationPipe } from "../../../../pipes/translation.pipe";
|
||||
import { NpsFile, TranslateData } from "../../dto/translate_data.dto";
|
||||
import { TranslateBlockComponent } from "../translate_block/translate_block.component";
|
||||
@@ -11,7 +11,7 @@ import { TranslateBlockComponent } from "../translate_block/translate_block.comp
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateBlockComponent, TranslationPipe],
|
||||
})
|
||||
export class TextListComponent implements OnInit {
|
||||
export class TextListComponent implements AfterViewInit {
|
||||
@ViewChildren("translateBlock") translate_blocks: QueryList<TranslateBlockComponent> | null =
|
||||
null;
|
||||
fileName = "";
|
||||
@@ -19,13 +19,14 @@ export class TextListComponent implements OnInit {
|
||||
@Input() set elements(el: TranslateData[]) {
|
||||
this.elements_data = el;
|
||||
localStorage.setItem("translations", JSON.stringify(this.elements_data));
|
||||
this.ngAfterViewInit();
|
||||
}
|
||||
|
||||
get elements() {
|
||||
return this.elements_data;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
ngAfterViewInit(): void {
|
||||
const data = localStorage.getItem("original_file");
|
||||
if (data) {
|
||||
const file: NpsFile = JSON.parse(data);
|
||||
|
||||
Reference in New Issue
Block a user