mirror of
https://github.com/KoboldAI/KoboldAI-Client.git
synced 2025-02-09 16:28:48 +01:00
Catch some edge cases when importing
This commit is contained in:
parent
643e0105d8
commit
0e855ef1d8
@ -1216,6 +1216,9 @@ def importRequest():
|
|||||||
file = open(importpath, "rb")
|
file = open(importpath, "rb")
|
||||||
vars.importjs = json.load(file)
|
vars.importjs = json.load(file)
|
||||||
|
|
||||||
|
if type(vars.importjs) is dict and "stories" in vars.importjs:
|
||||||
|
vars.importjs = vars.importjs["stories"]
|
||||||
|
|
||||||
# Clear Popup Contents
|
# Clear Popup Contents
|
||||||
emit('from_server', {'cmd': 'clearpopup', 'data': ''})
|
emit('from_server', {'cmd': 'clearpopup', 'data': ''})
|
||||||
|
|
||||||
@ -1269,7 +1272,7 @@ def importgame():
|
|||||||
else:
|
else:
|
||||||
vars.prompt = ""
|
vars.prompt = ""
|
||||||
vars.memory = ref["memory"]
|
vars.memory = ref["memory"]
|
||||||
vars.authornote = ref["authorsNote"]
|
vars.authornote = ref["authorsNote"] if type(ref["authorsNote"]) is str else ""
|
||||||
vars.actions = []
|
vars.actions = []
|
||||||
vars.worldinfo = []
|
vars.worldinfo = []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user