How do I login and show a file without the default rooms page showing up?

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);
}

Hello @joer00

Firstly, please let me know version of DocSpace that is being used. Also, please elaborate on your usage scenario – do I understand that you are embedding an editor into your own application?

Hi Constantine,

I am using version 1.0.1 and yes I am embedding the UI in my webpage.

My posted code was not 100% correct, I use also await on the create createHash method. But as mentioned, when I am not using the setTimeout, the getHashSettings method will never resolve its promise and hangs.

                        var hashSettings = await docSpaceManager.getHashSettings();
                        const passwordHash = await docSpaceManager.createHash(....

As I can see, DocSpace is also used as a storage for your files. Are you uploading files to DocSpace manually from your device or from another cloud storage?

I got this working, but there IS a bug in your code. You “onReady” event fires altought it is NOT ready.
Only if I add a timeout it works, otherwise createHash hangs forwever

            async function onAppReadWithTimeout() {
                try {
                    setTimeout(async () => {
                        var hashSettings = await docSpaceManager.getHashSettings();
                        const passwordHash = await docSpaceManager.createHash(password, hashSettings);
                        await docSpaceManager.login(userName, passwordHash);
                        console.log("Logged in for frame:" + frameId);
                        resolve();
                    }, 500);
                }
                catch (err) {
                    alert(`Error on login into docspace: ${err}`);
                }
            }

May I ask again what is the version of DocSpace used?

1.1 so the strange thing is that it works from our production domain, but not from test (localhost).

Both are added to allowed domains, and this sis work before

Version 1.1 of DocSpace was released back in 2021. I recommend updating it to the latest version 3.2.1 and see if the situation is resolved for your particular case.