Delaying code rendering in Monaco diffEditor until diff calculation is complete

I am currently developing with Monaco’s diffEditor and I have come across a problem. When I create the diffEditor and call setModel, the diff is calculated based on the diffAlgorithm. In cases where the calculation time is long, the code in the editor is displayed first, and then the diff is displayed quite a bit later.

This could potentially confuse users as they have no way to know the time it takes for the diff to be calculated. They might even assume it to be an error. Therefore, I want to prevent the code from being displayed until the diff is calculated. I’d prefer to show a loading or progress bar during this time. Is there a way to achieve this?

Below is the code I am using to create the editor:

function GitCommitDlg*displayDiffView(info) {
    const fileName = info[0].title;

    theApp.gitManager.getDiff(fileName, (originalCode, modifiedCode) => {
        if (this.diffEditor) this.diffEditor.dispose();
    
        this.diffEditor = monaco.editor.createDiffEditor(this.diffContentView.element, {
            originalEditable: false,    // for left pane
            readOnly: true,             // for right pane
            enableSplitViewResizing: true,
            automaticLayout: true,
        });
    
        const originalModel = this.createMonacoModel(originalCode);
        const modifiedModel = this.createMonacoModel(modifiedCode);
    
        this.diffEditor.setModel({
            original: originalModel,
            modified: modifiedModel,
        });
    });
};