Fix: page refresh restores default code

This commit is contained in:
Ofek Shilon
2024-05-11 17:29:11 +03:00
parent 15bcb0ab3d
commit 0741ec2fdc

View File

@@ -369,7 +369,9 @@ function findConfig(defaultConfig: ConfigType, options: CompilerExplorerOptions,
const savedState = sessionThenLocalStorage.get('gl', null);
if (savedState) config = JSON.parse(savedState);
}
if (!config.layout || !config.layout.content || config.layout.content === 0) config = defaultConfig;
if (!config.content || config.content.length === 0) {
config = defaultConfig;
}
}
} else {
config = _.extend(