@@ -67,7 +67,20 @@ export const useJsonStore = defineStore("json", {
6767 group ?: JsonKey ,
6868 ) {
6969 if ( ! group || group === "literature" ) {
70- this . literature = { ...this . literature , translations : literature } ;
70+ this . literature = {
71+ ...this . literature ,
72+ translations : literature ?. map ( ( l ) => {
73+ const original = this . literature . originals ?. find (
74+ ( o ) => o . id === l . id ,
75+ ) ;
76+ if ( ! original ) return l ;
77+
78+ return {
79+ ...original ,
80+ title : l . title ,
81+ } ;
82+ } ) ,
83+ } ;
7184 }
7285 if ( ! group || group === "outlines" ) {
7386 this . outlines = { ...this . outlines , translations : outlines } ;
@@ -151,7 +164,11 @@ export const useJsonStore = defineStore("json", {
151164 ( o ) =>
152165 ! ! o . title &&
153166 ! state . outlines . translations ?. some (
154- ( t ) => t . number === o . number && ! ! t . title && ! ! t . updated ,
167+ ( t ) =>
168+ t . number === o . number &&
169+ ! ! t . title &&
170+ ! ! t . updated &&
171+ ( ! o . notes || ! ! t . notes ) ,
155172 ) ,
156173 ) ?? [ ]
157174 ) ;
@@ -186,6 +203,19 @@ export const useJsonStore = defineStore("json", {
186203 tips : state . tips . translations ,
187204 } ;
188205 } ,
206+ wrongLiterature ( state ) {
207+ return (
208+ state . literature . originals ?. filter ( ( item ) => {
209+ const translation = state . literature . translations ?. find (
210+ ( t ) => t . id === item . id ,
211+ ) ;
212+ if ( ! translation ) return false ;
213+ if ( item . categoryName !== translation . categoryName ) return true ;
214+ if ( item . itemNumber !== translation . itemNumber ) return true ;
215+ if ( item . symbol !== translation . symbol ) return true ;
216+ } ) ?? [ ]
217+ ) ;
218+ } ,
189219 } ,
190220 persist : true ,
191221 state : ( ) : JsonState => ( {
0 commit comments