Add fmIndex checking in chat import
This commit is contained in:
@@ -343,7 +343,8 @@ export async function importChat(){
|
|||||||
message: [],
|
message: [],
|
||||||
note: "",
|
note: "",
|
||||||
name: "Imported Chat",
|
name: "Imported Chat",
|
||||||
localLore: []
|
localLore: [],
|
||||||
|
fmIndex: -1
|
||||||
}
|
}
|
||||||
|
|
||||||
let isFirst = true
|
let isFirst = true
|
||||||
@@ -376,6 +377,7 @@ export async function importChat(){
|
|||||||
if(json.type === 'risuChat' && json.ver === 1){
|
if(json.type === 'risuChat' && json.ver === 1){
|
||||||
const das:Chat = json.data
|
const das:Chat = json.data
|
||||||
if(!(checkNullish(das.message) || checkNullish(das.note) || checkNullish(das.name) || checkNullish(das.localLore))){
|
if(!(checkNullish(das.message) || checkNullish(das.note) || checkNullish(das.name) || checkNullish(das.localLore))){
|
||||||
|
das.fmIndex ??= -1
|
||||||
db.characters[selectedID].chats.unshift(das)
|
db.characters[selectedID].chats.unshift(das)
|
||||||
setDatabase(db)
|
setDatabase(db)
|
||||||
alertNormal(language.successImport)
|
alertNormal(language.successImport)
|
||||||
|
|||||||
Reference in New Issue
Block a user