refactor: Update settings menu index and open settings after importing character URL
This commit is contained in:
@@ -6,7 +6,7 @@ import { language } from "src/lang"
|
|||||||
import { v4 as uuidv4, v4 } from 'uuid';
|
import { v4 as uuidv4, v4 } from 'uuid';
|
||||||
import { characterFormatUpdate } from "./characters"
|
import { characterFormatUpdate } from "./characters"
|
||||||
import { AppendableBuffer, checkCharOrder, downloadFile, loadAsset, LocalWriter, openURL, readImage, saveAsset, VirtualWriter } from "./storage/globalApi"
|
import { AppendableBuffer, checkCharOrder, downloadFile, loadAsset, LocalWriter, openURL, readImage, saveAsset, VirtualWriter } from "./storage/globalApi"
|
||||||
import { CurrentCharacter, selectedCharID } from "./stores"
|
import { CurrentCharacter, SettingsMenuIndex, selectedCharID, settingsOpen } from "./stores"
|
||||||
import { convertImage, hasher } from "./parser"
|
import { convertImage, hasher } from "./parser"
|
||||||
import { CCardLib, type CharacterCardV3, type LorebookEntry } from '@risuai/ccardlib'
|
import { CCardLib, type CharacterCardV3, type LorebookEntry } from '@risuai/ccardlib'
|
||||||
import { reencodeImage } from "./process/files/image"
|
import { reencodeImage } from "./process/files/image"
|
||||||
@@ -260,7 +260,8 @@ export async function characterURLImport() {
|
|||||||
db.modules.push(importData)
|
db.modules.push(importData)
|
||||||
setDatabase(db)
|
setDatabase(db)
|
||||||
alertNormal(language.successImport)
|
alertNormal(language.successImport)
|
||||||
|
SettingsMenuIndex.set(1)
|
||||||
|
settingsOpen.set(true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(hash.startsWith('#import_preset=')){
|
if(hash.startsWith('#import_preset=')){
|
||||||
@@ -270,6 +271,8 @@ export async function characterURLImport() {
|
|||||||
name: 'imported.risupreset',
|
name: 'imported.risupreset',
|
||||||
data: importData
|
data: importData
|
||||||
})
|
})
|
||||||
|
SettingsMenuIndex.set(14)
|
||||||
|
settingsOpen.set(true)
|
||||||
return
|
return
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user