I use the code below to create a new file and show it in the editor. There are two issues:
1.) Using onAppReady does not work unless its called using setTimeout with abt 1 second delay .
I reported this as a bug in github. ( getHashSettings hangs forever)
2.) initManager shows the default page with rooms etc. I do not want this to show, the user should be directed right to the new file. I tried to use initSystem but then it says getHashSettings is invalid.
The mode is set to system, this seems to do nothing ! Still shows the default screen. If I use initEditor i get a blank screen with no errors.
How do I do this correctly ?
const configManager = {
mode: "system",
frameId: frameId,
events: { onAppReady, onAppError },
};
var docspace = DocSpace.SDK.initManager(configManager);
async function onAppReady(){
var hashSettings = await docSpaceManager.getHashSettings();
const passwordHash = docSpaceManager.createHash(password, hashSettings);
await docSpaceManager.login(userName, passwordHash);
const frame = DocSpace.SDK.frames[frameId];
const selectedFolder = roomId;
const res = await frame.createFile(selectedFolder, fileName);
const configEditor = {
id: res.id,
frameId: frameId,
width: "100%",
height: "100%"
};
DocSpace.SDK.initEditor(configEditor);
}